UNPKG

graceful-unwinding-widget

Version:

graceful-unwinding-widget React component

1,153 lines 1.53 MB
{ "contractName": "IUnwind", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "_cdp", "type": "uint256" } ], "name": "unwind", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_cdp", "type": "uint256" } ], "name": "charge", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "period", "outputs": [ { "internalType": "uint256", "name": "_period", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "fee", "outputs": [ { "internalType": "uint256", "name": "_fee", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "flat", "outputs": [ { "internalType": "bool", "name": "_flat", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "payments", "outputs": [ { "internalType": "uint256", "name": "_period", "type": "uint256" }, { "internalType": "uint256", "name": "_fee", "type": "uint256" }, { "internalType": "bool", "name": "_flat", "type": "bool" } ], "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.2+commit.bacdbe57\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_cdp\",\"type\":\"uint256\"}],\"name\":\"charge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flat\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_flat\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"payments\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_period\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_flat\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"period\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_period\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_cdp\",\"type\":\"uint256\"}],\"name\":\"unwind\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/ka/Projects/Altoros/graceful-unwind/smart-contracts/contracts/Unwind.sol\":\"IUnwind\"},\"evmVersion\":\"constantinople\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/ka/Projects/Altoros/graceful-unwind/smart-contracts/contracts/Unwind.sol\":{\"keccak256\":\"0x60e0e21e0a9a7e42496b9320587717ce65cdff0f0f16207e386a027db703bafd\",\"urls\":[\"bzz-raw://c20e123e6fa09d281e2ed7ce24c216c378e3be66833627a4ebf3c11694e3aaaf\",\"dweb:/ipfs/QmfNtrHZJnB8q44JwwmdBMwZV1PfQMAp1kPSqxs2Mc5mvn\"]},\"/Users/ka/Projects/Altoros/graceful-unwind/smart-contracts/contracts/WithOperator.sol\":{\"keccak256\":\"0xb51a0050f2372b4abe2849fe80f2579cdac21a89caa016c95aff585dde7faf05\",\"urls\":[\"bzz-raw://7ddb2157b7fad0fae747523d0cf4bb3a3ab3d397cc204058fea7e000c3834070\",\"dweb:/ipfs/QmcDrM2igLQiiTYBRwC5k8h1hR7mudQrgoS2LZuWZUqzs6\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity 0.6.2;\n\nimport \"./WithOperator.sol\";\n\ninterface IFaucet {\n function gulp(address) external;\n}\n\ninterface ISpot {\n function ilks(bytes32 _ilk) external view returns (address _pip, uint256 _mat);\n}\n\ninterface IUnwind {\n function unwind(uint256 _cdp) external;\n function charge(uint256 _cdp) external;\n function period() external view returns (uint256 _period);\n function fee() external view returns (uint256 _fee);\n function flat() external view returns (bool _flat);\n function payments() external view returns (uint256 _period, uint256 _fee, bool _flat);\n}\n\ninterface IRegistry {\n function lookup(bytes32 _name) external view returns (address _addr);\n function lookupToken(bytes32 ilk) external view returns (address addr);\n}\n\ninterface IDSProxy {\n function owner() external view returns (address);\n function execute(address, bytes calldata) external payable returns (bytes memory);\n}\n\ninterface ICdpManager {\n function cdpCan(address, uint, address) external view returns (uint);\n function owns(uint) external view returns (address);\n function urns(uint) external view returns (address);\n function ilks(uint) external view returns (bytes32);\n function vat() external view returns (address);\n function frob(uint, int, int) external;\n function flux(uint, address, uint) external;\n function move(uint, address, uint) external;\n}\n\ninterface IMatchingMarket {\n function sellAllAmount(address pay_gem, uint256 pay_amt, address buy_gem, uint256 min_fill_amount) external returns (uint256 fill_amt);\n}\n\ninterface IERC20 {\n function totalSupply() external view returns (uint supply);\n function balanceOf(address _owner) external view returns (uint balance);\n function transfer(address _to, uint _value) external returns (bool success);\n function transferFrom(address _from, address _to, uint _value) external returns (bool success);\n function approve(address _spender, uint _value) external returns (bool success);\n function allowance(address _owner, address _spender) external view returns (uint remaining);\n function decimals() external view returns(uint digits);\n}\n\ninterface IVat {\n function ilks(bytes32) external view returns (uint, uint, uint, uint, uint);\n function dai(address) external view returns (uint);\n function urns(bytes32, address) external view returns (uint, uint);\n function can(address, address) external view returns (uint);\n function hope(address) external;\n}\n\ninterface IGem {\n function approve(address, uint) external;\n}\n\ninterface IDaiJoin {\n function dai() external returns (IGem);\n function join(address, uint) external payable;\n function exit(address, uint) external;\n}\n\ninterface IGemJoin {\n function exit(address, uint) external;\n}\n\ninterface IJug {\n function drip(bytes32) external returns (uint);\n}\n\nabstract contract IWallet is IERC20 {\n function deposit() external virtual payable;\n function withdraw(uint256 _amount) external virtual;\n}\n\ncontract Unwind {\n event LogUnwind(uint256 cdp);\n event LogCharge(uint256 cdp, uint256 amount);\n\n IRegistry public registry;\n address public beneficiary;\n uint256 public period;\n uint256 public fee;\n bool public flat;\n\n uint constant WAD = 10 ** 18;\n uint constant RAY = 10 ** 27;\n\n // name => contract\n mapping(bytes32 => address) services;\n mapping(bytes32 => address) tokens;\n\n // cdp => charge expiration date\n mapping (uint256 => uint256) public charges;\n\n modifier allowed(uint256 cdp) {\n require(cdpManager().cdpCan(cdpManager().owns(cdp), cdp, address(this)) == 1, \"ERROR::CDP_NOT_ALLOWED\");\n _;\n }\n\n constructor(address _registry, address _beneficiary, uint256 _period, uint256 _fee, bool _flat) public {\n require(_registry != address(0), \"ERROR::INVALID_ADDRESS\");\n require(_beneficiary != address(0), \"ERROR::INVALID_ADDRESS\");\n require(_period != 0, \"ERROR::INVALID_PERIOD\");\n\n if (_flat == true) {\n require(_fee <= 0.5 ether, \"ERROR::INVALID_FEE\");\n } else {\n require(_fee <= 0.1 ether, \"ERROR::INVALID_FEE\");\n }\n\n registry = IRegistry(_registry);\n beneficiary = _beneficiary;\n period = _period;\n fee = _fee;\n flat = _flat;\n\n //setService(\"SPOT\");\n// setService(\"VAT\");\n// setService(\"JUG\");\n// setService(\"DAI_JOIN\");\n// setService(\"ETH-A\");\n// setToken(\"ETH-A\");\n// setService(\"CDP_MANAGER\");\n// setService(\"DAI\");\n// setService(\"OASIS_TRADE\");\n }\n\n function getService(bytes32 _name) public view returns (address _addr) {\n _addr = registry.lookup(_name);\n require(_addr != address(0), \"ERROR::INVALID_ADDRESS\");\n }\n\n function getToken(bytes32 _name) public view returns (address _addr) {\n _addr = registry.lookupToken(_name);\n require(_addr != address(0), \"ERROR::INVALID_ADDRESS\");\n }\n\n function setService(bytes32 _name) public {\n services[_name] = registry.lookup(_name);\n require(services[_name] != address(0), \"ERROR::INVALID_ADDRESS\");\n }\n\n function setToken(bytes32 _name) public {\n tokens[_name] = registry.lookupToken(_name);\n require(tokens[_name] != address(0), \"ERROR::INVALID_ADDRESS\");\n }\n\n function payments() external view returns (uint256 _period, uint256 _fee, bool _flat) {\n _period = period;\n _fee = fee;\n _flat = flat;\n }\n\n function unwind(uint256 cdp) external allowed(cdp) {\n address urn = cdpManager().urns(cdp);\n bytes32 ilk = cdpManager().ilks(cdp);\n\n (, uint256 rate, uint256 spot,,) = vat().ilks(ilk);\n (uint256 ink, uint256 art) = vat().urns(ilk, urn);\n\n uint256 bat = mul(ink, spot);\n uint256 tab = mul(art, rate);\n\n require(\n (mul(bat, 1000)) > mul(tab, 1034) && (mul(bat, 1000)) < mul(tab, 1100),\n \"ERROR::NOT_UNWINDABLE\"\n );\n\n //uint256 amount = ink - (art * RAY) / spot;\n\n //uint amount = ink - tab / spot;\n\n //uint256 amount = (bat - tab) / spot;\n\n uint256 amount = sub(bat, tab) / spot;\n\n // uint256 amount = mul(ink, 61) / 1000;\n\n cdpManager().frob(cdp, -toInt(amount), getWipeDart(urn, ilk));\n\n // Move the amount from the CDP urn to unwind contract\n cdpManager().flux(cdp, address(this), amount);\n\n // Exits token amount to unwind contract as a token\n gemJoin(ilk).exit(address(this), amount);\n\n token(ilk).approve(address(exchange()), amount);\n\n uint256 daiAmount = exchange().sellAllAmount(address(token(ilk)), amount, address(dai()), 0);\n\n daiJoin().dai().approve(address(daiJoin()), daiAmount);\n daiJoin().join(urn, daiAmount);\n\n cdpManager().frob(cdp, 0, getWipeDart(urn, ilk));\n\n emit LogUnwind(cdp);\n }\n\n function charge(uint256 cdp) external allowed(cdp) {\n if (charges[cdp] != 0) {\n require(block.timestamp >= charges[cdp], \"ERROR::CDP_ALREADY_CHARGED\");\n charges[cdp] = charges[cdp] + (block.timestamp - charges[cdp]) / period + period;\n } else {\n charges[cdp] = block.timestamp + period;\n }\n\n address urn = cdpManager().urns(cdp);\n bytes32 ilk = cdpManager().ilks(cdp);\n\n uint256 chargeAmount;\n if (flat == true) {\n chargeAmount = fee;\n } else {\n (, uint256 art) = vat().urns(ilk, urn);\n\n chargeAmount = art * fee / WAD;\n }\n\n // Generate debt in the CDP\n cdpManager().frob(cdp, 0, getDrawDart(urn, ilk, chargeAmount));\n // Moves the DAI amount (balance in the vat in rad) to unwind's address\n cdpManager().move(cdp, address(this), toRad(chargeAmount));\n // Allows access to DAI balance in the vat\n if (vat().can(address(this), address(daiJoin())) == 0) {\n vat().hope(address(daiJoin()));\n }\n // Exits DAI to the user's wallet as a token\n daiJoin().exit(beneficiary, chargeAmount);\n\n emit LogCharge(cdp, chargeAmount);\n }\n\n function getDrawDart(\n address urn,\n bytes32 ilk,\n uint wad\n ) public returns (int dart) {\n // Updates stability fee rate\n uint rate = jug().drip(ilk);\n\n // Gets DAI balance of the urn in the vat\n uint dai = vat().dai(urn);\n\n // If there was already enough DAI in the vat balance, just exits it without adding more debt\n if (dai < mul(wad, RAY)) {\n // Calculates the needed dart so together with the existing dai in the vat is enough to exit wad amount of DAI tokens\n dart = toInt(sub(mul(wad, RAY), dai) / rate);\n // This is neeeded due lack of precision. It might need to sum an extra dart wei (for the given DAI wad amount)\n dart = mul(uint(dart), rate) < mul(wad, RAY) ? dart + 1 : dart;\n }\n }\n\n function getWipeDart(address urn, bytes32 ilk) public view returns (int dart) {\n uint256 dai = vat().dai(urn);\n // Gets actual rate from the vat\n (, uint rate,,,) = vat().ilks(ilk);\n // Gets actual art value of the urn\n (, uint art) = vat().urns(ilk, urn);\n\n // Uses the whole dai balance in the vat to reduce the debt\n dart = toInt(dai / rate);\n // Checks the calculated dart is not higher than urn.art (total debt), otherwise uses its value\n dart = uint(dart) <= art ? - dart : - toInt(art);\n }\n\n function spot() internal view returns (ISpot) {\n //return ISpot(services[\"SPOT\"]);\n return ISpot(getService(\"SPOT\"));\n }\n\n function vat() internal view returns (IVat) {\n //return IVat(services[\"VAT\"]);\n return IVat(getService(\"VAT\"));\n }\n\n function jug() internal view returns (IJug) {\n return IJug(getService(\"JUG\"));\n }\n\n function daiJoin() internal view returns (IDaiJoin) {\n return IDaiJoin(getService(\"DAI_JOIN\"));\n }\n\n function gemJoin(bytes32 ilk) internal view returns (IGemJoin) {\n return IGemJoin(getService(ilk));\n }\n\n function cdpManager() internal view returns (ICdpManager) {\n return ICdpManager(getService(\"CDP_MANAGER\"));\n }\n\n function dai() internal view returns (IERC20) {\n return IERC20(getService(\"DAI\"));\n }\n\n function exchange() internal view returns (IMatchingMarket) {\n return IMatchingMarket(getService(\"OASIS_TRADE\"));\n }\n\n function token(bytes32 ilk) internal view returns (IERC20) {\n return IERC20(getToken(ilk));\n }\n\n function toInt(uint256 x) internal pure returns (int256 y) {\n y = int(x);\n require(y >= 0, \"int-overflow\");\n }\n\n\n function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x, \"mul-overflow\");\n }\n\n function add(uint x, uint y) internal pure returns (uint z) {\n require((z = x + y) >= x);\n }\n\n function sub(uint x, uint y) internal pure returns (uint z) {\n require((z = x - y) <= x, \"sub-overflow\");\n }\n\n function min(uint x, uint y) internal pure returns (uint z) {\n return x <= y ? x : y;\n }\n\n function toRad(uint wad) internal pure returns (uint rad) {\n rad = mul(wad, RAY);\n }\n}\n\n", "sourcePath": "/Users/ka/Projects/Altoros/graceful-unwind/smart-contracts/contracts/Unwind.sol", "ast": { "absolutePath": "/Users/ka/Projects/Altoros/graceful-unwind/smart-contracts/contracts/Unwind.sol", "exportedSymbols": { "ICdpManager": [ 205 ], "IDSProxy": [ 140 ], "IDaiJoin": [ 351 ], "IERC20": [ 275 ], "IFaucet": [ 65 ], "IGem": [ 331 ], "IGemJoin": [ 359 ], "IJug": [ 367 ], "IMatchingMarket": [ 219 ], "IRegistry": [ 125 ], "ISpot": [ 75 ], "IUnwind": [ 110 ], "IVat": [ 323 ], "IWallet": [ 378 ], "Unwind": [ 1385 ] }, "id": 1386, "nodeType": "SourceUnit", "nodes": [ { "id": 58, "literals": [ "solidity", "0.6", ".2" ], "nodeType": "PragmaDirective", "src": "0:22:1" }, { "absolutePath": "/Users/ka/Projects/Altoros/graceful-unwind/smart-contracts/contracts/WithOperator.sol", "file": "./WithOperator.sol", "id": 59, "nodeType": "ImportDirective", "scope": 1386, "sourceUnit": 1594, "src": "24:28:1", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 65, "linearizedBaseContracts": [ 65 ], "name": "IFaucet", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "8c28cbe8", "id": 64, "implemented": false, "kind": "function", "modifiers": [], "name": "gulp", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 62, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 61, "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 64, "src": "92:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 60, "name": "address", "nodeType": "ElementaryTypeName", "src": "92:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "91:9:1" }, "returnParameters": { "id": 63, "nodeType": "ParameterList", "parameters": [], "src": "109:0:1" }, "scope": 65, "src": "78:32:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], "scope": 1386, "src": "54:58:1" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 75, "linearizedBaseContracts": [ 75 ], "name": "ISpot", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "d9638d36", "id": 74, "implemented": false, "kind": "function", "modifiers": [], "name": "ilks", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 68, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 67, "name": "_ilk", "nodeType": "VariableDeclaration", "overrides": null, "scope": 74, "src": "150:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 66, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "150:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "149:14:1" }, "returnParameters": { "id": 73, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 70, "name": "_pip", "nodeType": "VariableDeclaration", "overrides": null, "scope": 74, "src": "187:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 69, "name": "address", "nodeType": "ElementaryTypeName", "src": "187:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 72, "name": "_mat", "nodeType": "VariableDeclaration", "overrides": null, "scope": 74, "src": "201:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 71, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "201:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "186:28:1" }, "scope": 75, "src": "136:79:1", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1386, "src": "114:103:1" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 110, "linearizedBaseContracts": [ 110 ], "name": "IUnwind", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "fad898c2", "id": 80, "implemented": false, "kind": "function", "modifiers": [], "name": "unwind", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 78, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 77, "name": "_cdp", "nodeType": "VariableDeclaration", "overrides": null, "scope": 80, "src": "259:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 76, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "259:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "258:14:1" }, "returnParameters": { "id": 79, "nodeType": "ParameterList", "parameters": [], "src": "281:0:1" }, "scope": 110, "src": "243:39:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "e457e1e5", "id": 85, "implemented": false, "kind": "function", "modifiers": [], "name": "charge", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 83, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 82, "name": "_cdp", "nodeType": "VariableDeclaration", "overrides": null, "scope": 85, "src": "303:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 81, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "303:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "302:14:1" }, "returnParameters": { "id": 84, "nodeType": "ParameterList", "parameters": [], "src": "325:0:1" }, "scope": 110, "src": "287:39:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "ef78d4fd", "id": 90, "implemented": false, "kind": "function", "modifiers": [], "name": "period", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 86, "nodeType": "ParameterList", "parameters": [], "src": "346:2:1" }, "returnParameters": { "id": 89, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 88, "name": "_period", "nodeType": "VariableDeclaration", "overrides": null, "scope": 90, "src": "372:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 87, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "372:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "371:17:1" }, "scope": 110, "src": "331:58:1", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "ddca3f43", "id": 95, "implemented": false, "kind": "function", "modifiers": [], "name": "fee", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 91, "nodeType": "ParameterList", "parameters": [], "src": "406:2:1" }, "returnParameters": { "id": 94, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 93, "name": "_fee", "nodeType": "VariableDeclaration", "overrides": null, "scope": 95, "src": "432:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 92, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "432:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "431:14:1" }, "scope": 110, "src": "394:52:1", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "d0fda779", "id": 100, "implemented": false, "kind": "function", "modifiers": [], "name": "flat", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 96, "nodeType": "ParameterList", "parameters": [], "src": "464:2:1" }, "returnParameters": { "id": 99, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 98, "name": "_flat", "nodeType": "VariableDeclaration", "overrides": null, "scope": 100, "src": "490:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 97, "name": "bool", "nodeType": "ElementaryTypeName", "src": "490:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "489:12:1" }, "scope": 110, "src": "451:51:1", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "a6d23e10", "id": 109, "implemented": false, "kind": "function", "modifiers": [], "name": "payments", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 101, "nodeType": "ParameterList", "parameters": [], "src": "524:2:1" }, "returnParameters": { "id": 108, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 103, "name": "_period", "nodeType": "VariableDeclaration", "overrides": null, "scope": 109, "src": "550:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 102, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "550:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 105, "name": "_fee", "nodeType": "VariableDeclaration", "overrides": null, "scope": 109, "src": "567:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 104, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "567:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 107, "name": "_flat", "nodeType": "VariableDeclaration", "overrides": null, "scope": 109, "src": "581:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 106, "name": "bool", "nodeType": "ElementaryTypeName", "src": "581:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "549:43:1" }, "scope": 110, "src": "507:86:1", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1386, "src": "219:376:1" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 125, "linearizedBaseContracts": [ 125 ], "name": "IRegistry", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "f39ec1f7", "id": 117, "implemented": false, "kind": "function", "modifiers": [], "name": "lookup", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 113, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 112, "name": "_name", "nodeType": "VariableDeclaration", "overrides": null, "scope": 117, "src": "639:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 111, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "639:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "638:15:1" }, "returnParameters": { "id": 116, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 115, "name": "_addr", "nodeType": "VariableDeclaration", "overrides": null, "scope": 117, "src": "677:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 114, "name": "address", "nodeType": "ElementaryTypeName", "src": "677:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "676:15:1" }, "scope": 125, "src": "623:69:1", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "0c43feb3", "id": 124, "implemented": false, "kind": "function", "modifiers": [], "name": "lookupToken", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 120, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 119, "name": "ilk", "nodeType": "VariableDeclaration", "overrides": null, "scope": 124, "src": "718:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 118, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "718:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "717:13:1" }, "returnParameters": { "id": 123, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 122, "name": "addr", "nodeType": "VariableDeclaration", "overrides": null, "scope": 124, "src": "754:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 121, "name": "address", "nodeType": "ElementaryTypeName", "src": "754:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "753:14:1" }, "scope": 125, "src": "697:71:1", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1386, "src": "597:173:1" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 140, "linearizedBaseContracts": [ 140 ], "name": "IDSProxy", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "8da5cb5b", "id": 130, "implemented": false, "kind": "function", "modifiers": [], "name": "owner", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 126, "nodeType": "ParameterList", "parameters": [], "src": "811:2:1" }, "returnParameters": { "id": 129, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 128, "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 130, "src": "837:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 127, "name": "address", "nodeType": "ElementaryTypeName", "src": "837:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "836:9:1" }, "scope": 140, "src": "797:49:1", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "body": null, "documentation": null, "functionSelector": "1cff79cd", "id": 139, "implemented": false, "kind": "function", "modifiers": [], "name": "execute", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 135, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 132, "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 139, "src": "868:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 131, "name": "address", "nodeType": "ElementaryTypeName", "src": "868:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 134, "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 139, "src": "877:14:1", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes" }, "typeName": { "id": 133, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "877:5:1", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "867:25:1" }, "returnParameters": { "id": 138, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 137, "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 139, "src": "919:12:1", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 136, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "919:5:1", "typeDescriptions": { "typeIdentifier": "t_byt