mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
167 lines
52 KiB
JSON
167 lines
52 KiB
JSON
{
|
|
"address": "0xDdBF6Db80cBc398F150E5695044cC128828FfEed",
|
|
"abi": [
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "_vaultId",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "_wDaiToBorrow",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "_colType",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"name": "debtCeilingIsReachedExplicit",
|
|
"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": "address",
|
|
"name": "_dsa",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "_fromVaultId",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "_destVaultId",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"internalType": "string",
|
|
"name": "_destColType",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"name": "isDebtCeilingReached",
|
|
"outputs": [
|
|
{
|
|
"internalType": "string",
|
|
"name": "",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"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": "0x24a284081d3f13ed783eae2396441bc5e649a21a59983d9b50db29112e21088c",
|
|
"receipt": {
|
|
"to": null,
|
|
"from": "0xF953c3d475dc0a9877329F71e2CE3d2519a519A2",
|
|
"contractAddress": "0xDdBF6Db80cBc398F150E5695044cC128828FfEed",
|
|
"transactionIndex": 109,
|
|
"gasUsed": "1087202",
|
|
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
"blockHash": "0x290833d55fba64db15dd14e5dfae66d8907ae766b8b2b74dba9c443e517271f0",
|
|
"transactionHash": "0x24a284081d3f13ed783eae2396441bc5e649a21a59983d9b50db29112e21088c",
|
|
"logs": [],
|
|
"blockNumber": 11371891,
|
|
"cumulativeGasUsed": "6965362",
|
|
"status": 1,
|
|
"byzantium": true
|
|
},
|
|
"args": [],
|
|
"solcInputHash": "0c702ccad6439e7f34b6d311a794eaa1",
|
|
"metadata": "{\"compiler\":{\"version\":\"0.7.4+commit.3f05b770\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_vaultId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_wDaiToBorrow\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_colType\",\"type\":\"string\"}],\"name\":\"debtCeilingIsReachedExplicit\",\"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\":\"address\",\"name\":\"_dsa\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fromVaultId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_destVaultId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_destColType\",\"type\":\"string\"}],\"name\":\"isDebtCeilingReached\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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/ConditionDebtCeilingIsReached.sol\":\"ConditionDebtCeilingIsReached\"},\"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(2519000), 3140500, 3971000, 4345000];\\n}\\n\\nuint256 constant PREMIUM = 30;\\nuint256 constant VAULT_CREATION_COST = 200000;\\n\",\"keccak256\":\"0x5cca1830963e20e729d4daf462aa9280b10d77a8c18170eb54368d7b410d6671\",\"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/ConditionDebtCeilingIsReached.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 {GelatoBytes} from \\\"../../../lib/GelatoBytes.sol\\\";\\nimport {\\n _debtCeilingIsReachedNewVault,\\n _debtCeilingIsReached,\\n _getMakerVaultDebt,\\n _isVaultOwner\\n} from \\\"../../../functions/dapps/FMaker.sol\\\";\\nimport {\\n _getRealisedDebt\\n} from \\\"../../../functions/gelato/FGelatoDebtBridge.sol\\\";\\n\\ncontract ConditionDebtCeilingIsReached 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.isDebtCeilingReached.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 isDebtCeilingReached(\\n _dsa,\\n _fromVaultId,\\n _destVaultId,\\n _destColType\\n );\\n }\\n\\n function isDebtCeilingReached(\\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\\n uint256 wDaiToBorrow =\\n _getRealisedDebt(_getMakerVaultDebt(_fromVaultId));\\n\\n return\\n debtCeilingIsReachedExplicit(\\n _destVaultId,\\n wDaiToBorrow,\\n _destColType\\n )\\n ? \\\"DebtCeilingReached\\\"\\n : OK;\\n }\\n\\n function debtCeilingIsReachedExplicit(\\n uint256 _vaultId,\\n uint256 _wDaiToBorrow,\\n string memory _colType\\n ) public view returns (bool) {\\n return\\n _vaultId == 0\\n ? _debtCeilingIsReachedNewVault(_colType, _wDaiToBorrow)\\n : _debtCeilingIsReached(_vaultId, _wDaiToBorrow);\\n }\\n}\\n\",\"keccak256\":\"0x7f7167b7cf24ca2e7ce233d4cbe874dfabdecd684f99c9053a312efd02f7547d\",\"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 _debtCeilingIsReachedNewVault(\\n string memory _colType,\\n uint256 _amtToBorrow\\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 Art, uint256 rate, , uint256 line, ) = vat.ilks(ilk);\\n uint256 Line = vat.Line();\\n uint256 debt = vat.debt();\\n\\n uint256 dart = _getBorrowAmt(_amtToBorrow, 0, rate);\\n uint256 dtab = mul(rate, dart);\\n\\n debt = add(debt, dtab);\\n Art = add(Art, dart);\\n\\n return mul(Art, rate) > line || debt > Line;\\n}\\n\\nfunction _debtCeilingIsReached(uint256 _vaultId, uint256 _amtToBorrow)\\n view\\n returns (bool)\\n{\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n IVat vat = IVat(manager.vat());\\n\\n (bytes32 ilk, address urn) = _getVaultData(manager, _vaultId);\\n\\n (uint256 Art, uint256 rate, , uint256 line, ) = vat.ilks(ilk);\\n uint256 dai = vat.dai(urn);\\n uint256 Line = vat.Line();\\n uint256 debt = vat.debt();\\n\\n uint256 dart = _getBorrowAmt(_amtToBorrow, dai, rate);\\n uint256 dtab = mul(rate, dart);\\n\\n debt = add(debt, dtab);\\n Art = add(Art, dart);\\n\\n return mul(Art, rate) > line || debt > Line;\\n}\\n\\nfunction _debtIsDustNewVault(string memory _colType, uint256 _amtToBorrow)\\n view\\n returns (bool)\\n{\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n IVat vat = IVat(manager.vat());\\n\\n bytes32 ilk = _stringToBytes32(_colType);\\n\\n (, uint256 rate, , , uint256 dust) = vat.ilks(ilk);\\n uint256 art = _getBorrowAmt(_amtToBorrow, 0, rate);\\n\\n uint256 tab = mul(rate, art);\\n\\n return tab < dust;\\n}\\n\\nfunction _debtIsDust(uint256 _vaultId, uint256 _amtToBorrow)\\n view\\n returns (bool)\\n{\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n IVat vat = IVat(manager.vat());\\n\\n (bytes32 ilk, address urn) = _getVaultData(manager, _vaultId);\\n (, uint256 art) = vat.urns(ilk, urn);\\n (, uint256 rate, , , uint256 dust) = vat.ilks(ilk);\\n\\n uint256 dai = vat.dai(urn);\\n uint256 dart = _getBorrowAmt(_amtToBorrow, dai, rate);\\n art = add(art, dart);\\n uint256 tab = mul(rate, art);\\n\\n return tab < dust;\\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\":\"0x85f307755d9294a821166840e161435dc38bdbddc598866b3e06b8faa6889ff6\",\"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 function debt() external view returns (uint256);\\n\\n // solhint-disable-next-line\\n function Line() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x160ee2f0a3d0d39d39471bba8f6d5433b8317c5a421d9b92e9e5b8f8811e0cd0\",\"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": "0x608060405234801561001057600080fd5b506112b7806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063475470411461005157806359d6b78a1461007a57806361d10bf01461009a578063a99891c5146100ad575b600080fd5b61006461005f36600461108b565b6100c0565b6040516100719190611170565b60405180910390f35b61008d610088366004610f71565b6100e9565b604051610071919061117b565b61008d6100a8366004610fd2565b61017e565b61008d6100bb36600461103a565b6101de565b600083156100d7576100d28484610220565b6100e1565b6100e182846104fb565b949350505050565b60606100f58386610752565b610100576000610102565b825b925060006101176101128661095a565b610bbf565b90506101248482856100c0565b61014857604051806040016040528060028152602001614f4b60f01b815250610174565b604051806040016040528060128152602001711119589d10d95a5b1a5b99d4995858da195960721b8152505b9695505050505050565b60606359d6b78a60e01b86868686866040516024016101a1959493929190611124565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b606060008080836101f2876004818b611195565b8101906101ff9190610f71565b9350935093509350610213848484846100e9565b9998505050505050505050565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561027557600080fd5b505afa158015610289573d6000803e3d6000fd5b505050506040513d602081101561029f57600080fd5b505190506000806102b08488610bd3565b915091506000806000856001600160a01b031663d9638d36866040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156102fd57600080fd5b505afa158015610311573d6000803e3d6000fd5b505050506040513d60a081101561032757600080fd5b50805160208083015160609093015160408051633612d9a360e11b81526001600160a01b038a811660048301529151949850949650909450600093908a1692636c25b34692602480840193919291829003018186803b15801561038957600080fd5b505afa15801561039d573d6000803e3d6000fd5b505050506040513d60208110156103b357600080fd5b50516040805163babe8a3f60e01b815290519192506000916001600160a01b038a169163babe8a3f916004808301926020929190829003018186803b1580156103fb57600080fd5b505afa15801561040f573d6000803e3d6000fd5b505050506040513d602081101561042557600080fd5b505160408051630dca59c160e01b815290519192506000916001600160a01b038b1691630dca59c1916004808301926020929190829003018186803b15801561046d57600080fd5b505afa158015610481573d6000803e3d6000fd5b505050506040513d602081101561049757600080fd5b5051905060006104a88d8588610cc8565b905060006104b68783610d29565b90506104c28382610d8c565b92506104ce8883610d8c565b9750856104db8989610d29565b11806104e657508383115b9c505050505050505050505050505b92915050565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561055057600080fd5b505afa158015610564573d6000803e3d6000fd5b505050506040513d602081101561057a57600080fd5b50519050600061058986610ddb565b90506000806000846001600160a01b031663d9638d36856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156105d457600080fd5b505afa1580156105e8573d6000803e3d6000fd5b505050506040513d60a08110156105fe57600080fd5b5080516020808301516060909301516040805163babe8a3f60e01b8152905193975093955093506000926001600160a01b0389169263babe8a3f92600480840193919291829003018186803b15801561065657600080fd5b505afa15801561066a573d6000803e3d6000fd5b505050506040513d602081101561068057600080fd5b505160408051630dca59c160e01b815290519192506000916001600160a01b03891691630dca59c1916004808301926020929190829003018186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d60208110156106f257600080fd5b5051905060006107038b8287610cc8565b905060006107118683610d29565b905061071d8382610d8c565b92506107298783610d8c565b9650846107368888610d29565b118061074157508383115b9d9c50505050505050505050505050565b600082610761575060006104f5565b735ef30b9986345249bc32d8928b7ee64de9435e396001600160a01b0316638161b120846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156107b957600080fd5b505afa9250505080156107de57506040513d60208110156107d957600080fd5b505160015b610945576107ea6111c3565b806107f557506108f8565b806040516020018080742326b0b5b2b9172fb4b9ab30bab63a27bbb732b91d60591b81525060150182805190602001908083835b602083106108485780518252601f199092019160209182019101610829565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192965094508493604401925085019080838360005b838110156108bd5781810151838201526020016108a5565b50505050905090810190601f1680156108ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805162461bcd60e51b815260206004820152601e60248201527f464d616b65722e5f69735661756c744f776e65723a756e646566696e65640000604482015290519081900360640190fd5b6001600160a01b0383811691161490506104f5565b6000735ef30b9986345249bc32d8928b7ee64de9435e39818061097d8386610bd3565b915091506000836001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b505160408051636cb1c69b60e11b81526004810186905290519192506000916001600160a01b0384169163d9638d369160248083019260a0929190829003018186803b158015610a3557600080fd5b505afa158015610a49573d6000803e3d6000fd5b505050506040513d60a0811015610a5f57600080fd5b5060200151604080516309092f9760e21b8152600481018790526001600160a01b038681166024830152825193945060009390861692632424be5c9260448082019391829003018186803b158015610ab657600080fd5b505afa158015610aca573d6000803e3d6000fd5b505050506040513d6040811015610ae057600080fd5b5060209081015160408051633612d9a360e11b81526001600160a01b038881166004830152915192945060009391871692636c25b34692602480840193919291829003018186803b158015610b3457600080fd5b505afa158015610b48573d6000803e3d6000fd5b505050506040513d6020811015610b5e57600080fd5b505190506000610b77610b718486610d29565b83610e2b565b90506b033b2e3c9fd0803ce80000008104985080610ba18a6b033b2e3c9fd0803ce8000000610d29565b10610bac5788610bb1565b886001015b9a9950505050505050505050565b60006104f582670df27a2cdf448000610e7b565b600080836001600160a01b0316632c2cb9fd846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610c1a57600080fd5b505afa158015610c2e573d6000803e3d6000fd5b505050506040513d6020811015610c4457600080fd5b505160408051632726b07360e01b81526004810186905290519193506001600160a01b03861691632726b07391602480820192602092909190829003018186803b158015610c9157600080fd5b505afa158015610ca5573d6000803e3d6000fd5b505050506040513d6020811015610cbb57600080fd5b5051919491935090915050565b600081610cea610ce4866b033b2e3c9fd0803ce8000000610d29565b85610e2b565b81610cf157fe5b049050610d0a846b033b2e3c9fd0803ce8000000610d29565b610d148284610d29565b10610d1f57806100e1565b6001019392505050565b6000811580610d4457505080820282828281610d4157fe5b04145b6104f5576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b808201828110156104f5576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b6000815160001415610e23576040805162461bcd60e51b815260206004820152600c60248201526b737472696e672d656d70747960a01b604482015290519081900360640190fd5b506020015190565b808203828111156104f5576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b6000670de0b6b3a7640000610ea1610e938585610d29565b6706f05b59d3b20000610d8c565b81610ea857fe5b049392505050565b60008083601f840112610ec1578182fd5b50813567ffffffffffffffff811115610ed8578182fd5b602083019150836020828501011115610ef057600080fd5b9250929050565b600082601f830112610f07578081fd5b813567ffffffffffffffff80821115610f1c57fe5b604051601f8301601f191681016020018281118282101715610f3a57fe5b604052828152925082848301602001861015610f5557600080fd5b8260208601602083013760006020848301015250505092915050565b60008060008060808587031215610f86578384fd5b8435610f9181611269565b93506020850135925060408501359150606085013567ffffffffffffffff811115610fba578182fd5b610fc687828801610ef7565b91505092959194509250565b600080600080600060808688031215610fe9578081fd5b8535610ff481611269565b94506020860135935060408601359250606086013567ffffffffffffffff81111561101d578182fd5b61102988828901610eb0565b969995985093965092949392505050565b6000806000806060858703121561104f578384fd5b84359350602085013567ffffffffffffffff81111561106c578384fd5b61107887828801610eb0565b9598909750949560400135949350505050565b60008060006060848603121561109f578283fd5b8335925060208401359150604084013567ffffffffffffffff8111156110c3578182fd5b6110cf86828701610ef7565b9150509250925092565b60008151808452815b818110156110fe576020818501810151868301820152016110e2565b8181111561110f5782602083870101525b50601f01601f19169290920160200192915050565b600060018060a01b038716825285602083015284604083015260806060830152826080830152828460a084013781830160a090810191909152601f909201601f19160101949350505050565b901515815260200190565b60006020825261118e60208301846110d9565b9392505050565b600080858511156111a4578182fd5b838611156111b0578182fd5b5050820193919092039150565b60e01c90565b600060443d10156111d357611266565b600481823e6308c379a06111e782516111bd565b146111f157611266565b6040513d600319016004823e80513d67ffffffffffffffff81602484011181841117156112215750505050611266565b8284019250825191508082111561123b5750505050611266565b503d8301602082840101111561125357505050611266565b601f01601f191681016020016040529150505b90565b6001600160a01b038116811461127e57600080fd5b5056fea2646970667358221220f52e3fe68aba8bbb3565c0c40cd11f860a8334af1e77ae67d7c888ea69a2be2564736f6c63430007040033",
|
|
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063475470411461005157806359d6b78a1461007a57806361d10bf01461009a578063a99891c5146100ad575b600080fd5b61006461005f36600461108b565b6100c0565b6040516100719190611170565b60405180910390f35b61008d610088366004610f71565b6100e9565b604051610071919061117b565b61008d6100a8366004610fd2565b61017e565b61008d6100bb36600461103a565b6101de565b600083156100d7576100d28484610220565b6100e1565b6100e182846104fb565b949350505050565b60606100f58386610752565b610100576000610102565b825b925060006101176101128661095a565b610bbf565b90506101248482856100c0565b61014857604051806040016040528060028152602001614f4b60f01b815250610174565b604051806040016040528060128152602001711119589d10d95a5b1a5b99d4995858da195960721b8152505b9695505050505050565b60606359d6b78a60e01b86868686866040516024016101a1959493929190611124565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b606060008080836101f2876004818b611195565b8101906101ff9190610f71565b9350935093509350610213848484846100e9565b9998505050505050505050565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561027557600080fd5b505afa158015610289573d6000803e3d6000fd5b505050506040513d602081101561029f57600080fd5b505190506000806102b08488610bd3565b915091506000806000856001600160a01b031663d9638d36866040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156102fd57600080fd5b505afa158015610311573d6000803e3d6000fd5b505050506040513d60a081101561032757600080fd5b50805160208083015160609093015160408051633612d9a360e11b81526001600160a01b038a811660048301529151949850949650909450600093908a1692636c25b34692602480840193919291829003018186803b15801561038957600080fd5b505afa15801561039d573d6000803e3d6000fd5b505050506040513d60208110156103b357600080fd5b50516040805163babe8a3f60e01b815290519192506000916001600160a01b038a169163babe8a3f916004808301926020929190829003018186803b1580156103fb57600080fd5b505afa15801561040f573d6000803e3d6000fd5b505050506040513d602081101561042557600080fd5b505160408051630dca59c160e01b815290519192506000916001600160a01b038b1691630dca59c1916004808301926020929190829003018186803b15801561046d57600080fd5b505afa158015610481573d6000803e3d6000fd5b505050506040513d602081101561049757600080fd5b5051905060006104a88d8588610cc8565b905060006104b68783610d29565b90506104c28382610d8c565b92506104ce8883610d8c565b9750856104db8989610d29565b11806104e657508383115b9c505050505050505050505050505b92915050565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561055057600080fd5b505afa158015610564573d6000803e3d6000fd5b505050506040513d602081101561057a57600080fd5b50519050600061058986610ddb565b90506000806000846001600160a01b031663d9638d36856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156105d457600080fd5b505afa1580156105e8573d6000803e3d6000fd5b505050506040513d60a08110156105fe57600080fd5b5080516020808301516060909301516040805163babe8a3f60e01b8152905193975093955093506000926001600160a01b0389169263babe8a3f92600480840193919291829003018186803b15801561065657600080fd5b505afa15801561066a573d6000803e3d6000fd5b505050506040513d602081101561068057600080fd5b505160408051630dca59c160e01b815290519192506000916001600160a01b03891691630dca59c1916004808301926020929190829003018186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d60208110156106f257600080fd5b5051905060006107038b8287610cc8565b905060006107118683610d29565b905061071d8382610d8c565b92506107298783610d8c565b9650846107368888610d29565b118061074157508383115b9d9c50505050505050505050505050565b600082610761575060006104f5565b735ef30b9986345249bc32d8928b7ee64de9435e396001600160a01b0316638161b120846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156107b957600080fd5b505afa9250505080156107de57506040513d60208110156107d957600080fd5b505160015b610945576107ea6111c3565b806107f557506108f8565b806040516020018080742326b0b5b2b9172fb4b9ab30bab63a27bbb732b91d60591b81525060150182805190602001908083835b602083106108485780518252601f199092019160209182019101610829565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192965094508493604401925085019080838360005b838110156108bd5781810151838201526020016108a5565b50505050905090810190601f1680156108ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805162461bcd60e51b815260206004820152601e60248201527f464d616b65722e5f69735661756c744f776e65723a756e646566696e65640000604482015290519081900360640190fd5b6001600160a01b0383811691161490506104f5565b6000735ef30b9986345249bc32d8928b7ee64de9435e39818061097d8386610bd3565b915091506000836001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b505160408051636cb1c69b60e11b81526004810186905290519192506000916001600160a01b0384169163d9638d369160248083019260a0929190829003018186803b158015610a3557600080fd5b505afa158015610a49573d6000803e3d6000fd5b505050506040513d60a0811015610a5f57600080fd5b5060200151604080516309092f9760e21b8152600481018790526001600160a01b038681166024830152825193945060009390861692632424be5c9260448082019391829003018186803b158015610ab657600080fd5b505afa158015610aca573d6000803e3d6000fd5b505050506040513d6040811015610ae057600080fd5b5060209081015160408051633612d9a360e11b81526001600160a01b038881166004830152915192945060009391871692636c25b34692602480840193919291829003018186803b158015610b3457600080fd5b505afa158015610b48573d6000803e3d6000fd5b505050506040513d6020811015610b5e57600080fd5b505190506000610b77610b718486610d29565b83610e2b565b90506b033b2e3c9fd0803ce80000008104985080610ba18a6b033b2e3c9fd0803ce8000000610d29565b10610bac5788610bb1565b886001015b9a9950505050505050505050565b60006104f582670df27a2cdf448000610e7b565b600080836001600160a01b0316632c2cb9fd846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610c1a57600080fd5b505afa158015610c2e573d6000803e3d6000fd5b505050506040513d6020811015610c4457600080fd5b505160408051632726b07360e01b81526004810186905290519193506001600160a01b03861691632726b07391602480820192602092909190829003018186803b158015610c9157600080fd5b505afa158015610ca5573d6000803e3d6000fd5b505050506040513d6020811015610cbb57600080fd5b5051919491935090915050565b600081610cea610ce4866b033b2e3c9fd0803ce8000000610d29565b85610e2b565b81610cf157fe5b049050610d0a846b033b2e3c9fd0803ce8000000610d29565b610d148284610d29565b10610d1f57806100e1565b6001019392505050565b6000811580610d4457505080820282828281610d4157fe5b04145b6104f5576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b808201828110156104f5576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b6000815160001415610e23576040805162461bcd60e51b815260206004820152600c60248201526b737472696e672d656d70747960a01b604482015290519081900360640190fd5b506020015190565b808203828111156104f5576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b6000670de0b6b3a7640000610ea1610e938585610d29565b6706f05b59d3b20000610d8c565b81610ea857fe5b049392505050565b60008083601f840112610ec1578182fd5b50813567ffffffffffffffff811115610ed8578182fd5b602083019150836020828501011115610ef057600080fd5b9250929050565b600082601f830112610f07578081fd5b813567ffffffffffffffff80821115610f1c57fe5b604051601f8301601f191681016020018281118282101715610f3a57fe5b604052828152925082848301602001861015610f5557600080fd5b8260208601602083013760006020848301015250505092915050565b60008060008060808587031215610f86578384fd5b8435610f9181611269565b93506020850135925060408501359150606085013567ffffffffffffffff811115610fba578182fd5b610fc687828801610ef7565b91505092959194509250565b600080600080600060808688031215610fe9578081fd5b8535610ff481611269565b94506020860135935060408601359250606086013567ffffffffffffffff81111561101d578182fd5b61102988828901610eb0565b969995985093965092949392505050565b6000806000806060858703121561104f578384fd5b84359350602085013567ffffffffffffffff81111561106c578384fd5b61107887828801610eb0565b9598909750949560400135949350505050565b60008060006060848603121561109f578283fd5b8335925060208401359150604084013567ffffffffffffffff8111156110c3578182fd5b6110cf86828701610ef7565b9150509250925092565b60008151808452815b818110156110fe576020818501810151868301820152016110e2565b8181111561110f5782602083870101525b50601f01601f19169290920160200192915050565b600060018060a01b038716825285602083015284604083015260806060830152826080830152828460a084013781830160a090810191909152601f909201601f19160101949350505050565b901515815260200190565b60006020825261118e60208301846110d9565b9392505050565b600080858511156111a4578182fd5b838611156111b0578182fd5b5050820193919092039150565b60e01c90565b600060443d10156111d357611266565b600481823e6308c379a06111e782516111bd565b146111f157611266565b6040513d600319016004823e80513d67ffffffffffffffff81602484011181841117156112215750505050611266565b8284019250825191508082111561123b5750505050611266565b503d8301602082840101111561125357505050611266565b601f01601f191681016020016040529150505b90565b6001600160a01b038116811461127e57600080fd5b5056fea2646970667358221220f52e3fe68aba8bbb3565c0c40cd11f860a8334af1e77ae67d7c888ea69a2be2564736f6c63430007040033",
|
|
"devdoc": {
|
|
"kind": "dev",
|
|
"methods": {},
|
|
"version": 1
|
|
},
|
|
"userdoc": {
|
|
"kind": "user",
|
|
"methods": {},
|
|
"version": 1
|
|
},
|
|
"storageLayout": {
|
|
"storage": [],
|
|
"types": null
|
|
}
|
|
}
|