{
  "contractName": "MathUtils",
  "abi": [
    {
      "constant": true,
      "inputs": [
        {
          "name": "_a",
          "type": "uint256"
        },
        {
          "name": "_b",
          "type": "uint256"
        }
      ],
      "name": "add",
      "outputs": [
        {
          "name": "_result",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "pure",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_a",
          "type": "uint256"
        },
        {
          "name": "_b",
          "type": "uint256"
        }
      ],
      "name": "subtract",
      "outputs": [
        {
          "name": "_result",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "pure",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_asset_weight",
          "type": "uint256"
        },
        {
          "name": "_unit_size",
          "type": "uint256"
        },
        {
          "name": "_fee_per_unit",
          "type": "uint256"
        }
      ],
      "name": "calculate_recast_fee",
      "outputs": [
        {
          "name": "_recast_fee",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "pure",
      "type": "function"
    }
  ],
  "bytecode": "0x6101d4610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f300730000000000000000000000000000000000000000301460806040526004361061006e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633ef5e44514610073578063771602f7146100b1578063a30d6c9f146100ef575b600080fd5b61009b6004803603810190808035906020019092919080359060200190929190505050610137565b6040518082815260200191505060405180910390f35b6100d96004803603810190808035906020019092919080359060200190929190505050610153565b6040518082815260200191505060405180910390f35b61012160048036038101908080359060200190929190803590602001909291908035906020019092919050505061016e565b6040518082815260200191505060405180910390f35b600081831015151561014857600080fd5b818303905092915050565b60008183019050828111151561016857600080fd5b92915050565b600080828502905082858281151561018257fe5b0414151561018f57600080fd5b838181151561019a57fe5b0491508191505093925050505600a165627a7a723058207e0f874a08d745165effb437ca3d161c4b82e75110269712d4c83a461db1d6060029",
  "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633ef5e44514610073578063771602f7146100b1578063a30d6c9f146100ef575b600080fd5b61009b6004803603810190808035906020019092919080359060200190929190505050610137565b6040518082815260200191505060405180910390f35b6100d96004803603810190808035906020019092919080359060200190929190505050610153565b6040518082815260200191505060405180910390f35b61012160048036038101908080359060200190929190803590602001909291908035906020019092919050505061016e565b6040518082815260200191505060405180910390f35b600081831015151561014857600080fd5b818303905092915050565b60008183019050828111151561016857600080fd5b92915050565b600080828502905082858281151561018257fe5b0414151561018f57600080fd5b838181151561019a57fe5b0491508191505093925050505600a165627a7a723058207e0f874a08d745165effb437ca3d161c4b82e75110269712d4c83a461db1d6060029",
  "sourceMap": "81:7080:82:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
  "deployedSourceMap": "81:7080:82:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1898:163;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1023:165;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6751:407;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1898:163;1994:12;2030:2;2024;:8;;2016:17;;;;;;;;2054:2;2049;:7;2039:17;;1898:163;;;;:::o;1023:165::-;1114:15;1154:2;1149;:7;1139:17;;1180:2;1170:7;:12;1162:21;;;;;;;;1023:165;;;;:::o;6751:407::-;6901:19;6930:34;6983:13;6967;:29;6930:66;;7056:13;7039;7010:26;:42;;;;;;;;:59;7002:68;;;;;;;;7119:10;7090:26;:39;;;;;;;;7076:53;;7142:11;7135:18;;6751:407;;;;;;:::o",
  "source": "pragma solidity ^0.4.19;\n\n/// @title Digix Math Library\n/// @author DigixGlobal\n\nlibrary MathUtils {\n\n  /*modifier if_safe_to_add(uint256 _x, uint256 _y) {\n    require(is_safe_to_add(_x, _y) == true);\n    _;\n  }\n\n  modifier if_safe_to_subtract(uint256 _x, uint256 _y) {\n    require(is_safe_to_subtract(_x, _y) == true);\n    _;\n  }*/\n\n  /*uint256 constant ONE_DAY = 1 days;*/\n\n  /// DEPRECATED\n  /// @notice Call with two integers to determine if they are safe to add\n  /// @dev Catches integer overflow\n  /// param _a Integer to add\n  /// param _b Integer to add\n  /// @return _issafe True if the integers are safe to add\n  /*function is_safe_to_add(uint256 _a, uint256 _b)\n           public\n           constant\n           returns (bool _is_safe)\n  {\n    _is_safe = (_a + _b >= _a);\n    return _is_safe;\n  }*/\n\n  /// @notice Returns sum of two safely-added integers\n  /// @dev Uses `safeToAdd` internally; throws if unsafe\n  /// @param _a Integer to add\n  /// @param _b Integer to add\n  /// @return _result Sum of inputs\n  function add(uint256 _a, uint256 _b)\n           public\n           pure\n           returns (uint256 _result)\n  {\n    _result = _a + _b;\n    require(_result > _a);\n  }\n\n  /// DEPRECATED\n  /// @notice Call with two integers to determine if they are safe to subtract\n  /// @dev Catches integer overflow\n  /// param _a Integer to subtract from\n  /// param _b Integer to subtract\n  /// @return _issafe True if the integers are safe to subtract\n  /*function is_safe_to_subtract(uint256 _a, uint256 _b)\n           public\n           constant\n           returns (bool _is_safe)\n  {\n    _is_safe = (_b <= _a);\n    return _is_safe;\n  }*/\n\n  /// @notice Returns result of two safely-subtracted integers\n  /// @dev Uses `safeToSubtract` internally; throws if unsafe\n  /// @param _a Integer to subtract from\n  /// @param _b Integer to subtract\n  /// @return _result Result of subtraction\n  function subtract(uint256 _a, uint256 _b)\n           public\n           pure\n           returns (uint _result)\n  {\n    require(_a >= _b);\n    _result = _a - _b;\n  }\n\n  /// DEPRECATED\n  ///# @notice Calculates the rate of ???\n  ///# @dev `((_unit * _a) + _b / 2) / _b`\n  ///# paramm _a ??\n  ///# paramm _b ??\n  ///# paramm _places Number of decimal places\n  ///# @return _result Result of subtraction\n  /*function rate_of(uint256 _a, uint256 _b, uint256 _places)\n           public\n           constant\n           returns (uint256 _result)\n  {\n    var _unit = 10 ** _places;\n    _result = add((_unit * _a), (_b / 2)) / _b;\n    return _result;\n  }*/\n\n  /// DEPRECATED\n  ///# @notice Calculates the rate from ???\n  ///# @dev `(_amount * _baserate) / (10 ** _places)`\n  ///# paramm _amount ??\n  ///# paramm _baserate ??\n  ///# paramm _places ??\n  ///# @return _fee Calculated Fee\n  /*function from_rate(uint256 _amount, uint256 _baserate, uint256 _places)\n           returns (uint256 _fee)\n  {\n    _fee = ((_amount * _baserate) / (10 ** _places));\n    return _fee;\n  }*/\n\n  /// DEPRECATED\n  ///# @notice Calculate demurrage time values\n  ///# paramm _current_time Current block time\n  ///# paramm _last_payment_date Last demurrage payment date\n  ///# @return {\n  ///   \"_next_payment_date\": \"Next payment date as unix time\",\n  ///   \"_demurrage_days\": \"Demurrage days calculated\"\n  /// }\n  /*function calculate_demurrage_time(uint256 _current_time, uint256 _last_payment_date)\n           returns (uint256 _next_payment_date, uint256 _demurrage_days)\n  {\n    var _time_difference = subtract(_current_time, _last_payment_date);\n    _demurrage_days = _time_difference / (1 days);\n    var _remainder = _time_difference % (1 days);\n    var _demurrage_seconds = _demurrage_days * (1 days);\n    _next_payment_date = subtract(add(_last_payment_date, _demurrage_seconds), _remainder);\n    return (_next_payment_date, _demurrage_days);\n  }*/\n\n  /// DEPRECATED\n  ///# @notice Calculate demurrage fee\n  ///# paramm _demurrage_days Days since last demurrage payment\n  ///# paramm _unit_size Minimum amount for demurrage fees\n  ///# paramm _fee_per_unit Amount of daily demurrage to deduct for every `_demurrage_minimum`\n  ///# paramm _raw_balance Account balance\n  ///# @return _demurrage_fee The demurrage fee due\n  /*function calculate_demurrage_fee(uint256 _demurrage_days, uint256 _unit_size, uint256 _fee_per_unit, uint256 _raw_balance)\n           returns (uint256 _demurrage_fee)\n  {\n    if (_demurrage_days == 0) {\n      _demurrage_fee = 0;\n    } else {\n      var _billable_amount = (_raw_balance / _unit_size);\n      _demurrage_fee = (_billable_amount * _demurrage_days * _fee_per_unit);\n    }\n    return _demurrage_fee;\n  }*/\n\n  /// DEPRECATED\n  ///# @notice Get demurrage info\n  ///# paramm _current_time Current block time\n  ///# paramm _last_payment_date Last demurrage payment date\n  ///# paramm _raw_balance Account balance\n  ///# paramm _unit_size Minimum amount needed to charge demurrage fees\n  ///# paramm _fee_per_unit The amount of daily demurrage deduct for every `_minimum_for_demurrage`\n  /// @return {\n  ///    \"_demurrage_fee\": \"Fee charged against current balance\",\n  ///    \"_demurrage_days\": \"Demurrage days calculated\",\n  ///    \"_billable_amount\": \"Amount eligible for demurrage calculation\",\n  ///    \"_next_payment_date\": \"Timestamp to use for next payment date\"\n  /// }\n  /*function get_demurrage_info(uint256 _current_time, uint256 _last_payment_date, uint256 _raw_balance, uint256 _unit_size, uint256 _fee_per_unit)\n           returns (uint256 _demurrage_fee, uint256 _demurrage_days, uint256 _balance_after, uint256 _next_payment_date)\n  {\n    _demurrage_days = (subtract(_current_time, _last_payment_date)) / ONE_DAY;\n    uint256 _billable_amount = (_raw_balance / _unit_size);\n    if (_demurrage_days == 0) {\n      _demurrage_fee = 0;\n      _next_payment_date = _last_payment_date;\n      _balance_after = _raw_balance;\n    } else {\n      _demurrage_fee = (_billable_amount * _demurrage_days * _fee_per_unit);\n      var _remainder = subtract(_current_time, _last_payment_date) % ONE_DAY;\n      _next_payment_date = subtract(add(_last_payment_date, (_demurrage_days * ONE_DAY)), _remainder);\n      _balance_after = subtract(_raw_balance, _demurrage_fee);\n    }\n    return (_demurrage_fee, _demurrage_days, _balance_after, _next_payment_date);\n  }*/\n\n  /// DEPRECATED\n  ///# @notice Calculate Transaction Fee\n  ///# paramm _sending_amount The amount being sent\n  ///# paramm _unit_size The minimum amount that can be sent\n  ///# paramm _fee_per_unit The fee per unit\n  ///# @return _tx_fee The transaction fee due\n  /*function get_tx_fee(uint256 _sending_amount, uint256 _unit_size, uint256 _fee_per_unit)\n           returns (uint256 _tx_fee)\n  {\n    _tx_fee = (_sending_amount / _unit_size) * _fee_per_unit;\n    return _tx_fee;\n  }*/\n\n  function calculate_recast_fee(uint256 _asset_weight, uint256 _unit_size, uint256 _fee_per_unit)\n           public\n           pure\n           returns (uint256 _recast_fee)\n  {\n    uint256 _weight_times_fee_per_unit = _asset_weight * _fee_per_unit;\n    require(_weight_times_fee_per_unit / _asset_weight == _fee_per_unit);\n    _recast_fee = _weight_times_fee_per_unit / _unit_size;\n    return _recast_fee;\n  }\n\n}\n",
  "sourcePath": "@digix/solidity-core-libraries/contracts/MathUtils.sol",
  "ast": {
    "absolutePath": "@digix/solidity-core-libraries/contracts/MathUtils.sol",
    "exportedSymbols": {
      "MathUtils": [
        25197
      ]
    },
    "id": 25198,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 25118,
        "literals": [
          "solidity",
          "^",
          "0.4",
          ".19"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:82"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": "@title Digix Math Library\n @author DigixGlobal",
        "fullyImplemented": true,
        "id": 25197,
        "linearizedBaseContracts": [
          25197
        ],
        "name": "MathUtils",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": {
              "id": 25139,
              "nodeType": "Block",
              "src": "1133:55:82",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25131,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 25127,
                      "name": "_result",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25125,
                      "src": "1139:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 25130,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 25128,
                        "name": "_a",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25120,
                        "src": "1149:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 25129,
                        "name": "_b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25122,
                        "src": "1154:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "1149:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1139:17:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 25132,
                  "nodeType": "ExpressionStatement",
                  "src": "1139:17:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 25136,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 25134,
                          "name": "_result",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25125,
                          "src": "1170:7:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 25135,
                          "name": "_a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25120,
                          "src": "1180:2:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1170:12:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 25133,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        26185,
                        26186
                      ],
                      "referencedDeclaration": 26185,
                      "src": "1162:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 25137,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1162:21:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 25138,
                  "nodeType": "ExpressionStatement",
                  "src": "1162:21:82"
                }
              ]
            },
            "documentation": "@notice Returns sum of two safely-added integers\n @dev Uses `safeToAdd` internally; throws if unsafe\n @param _a Integer to add\n @param _b Integer to add\n @return _result Sum of inputs",
            "id": 25140,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "add",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 25123,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25120,
                  "name": "_a",
                  "nodeType": "VariableDeclaration",
                  "scope": 25140,
                  "src": "1036:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25119,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1036:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25122,
                  "name": "_b",
                  "nodeType": "VariableDeclaration",
                  "scope": 25140,
                  "src": "1048:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25121,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1048:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1035:24:82"
            },
            "payable": false,
            "returnParameters": {
              "id": 25126,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25125,
                  "name": "_result",
                  "nodeType": "VariableDeclaration",
                  "scope": 25140,
                  "src": "1114:15:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25124,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1114:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1113:17:82"
            },
            "scope": 25197,
            "src": "1023:165:82",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 25161,
              "nodeType": "Block",
              "src": "2010:51:82",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 25152,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 25150,
                          "name": "_a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25142,
                          "src": "2024:2:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 25151,
                          "name": "_b",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25144,
                          "src": "2030:2:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2024:8:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 25149,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        26185,
                        26186
                      ],
                      "referencedDeclaration": 26185,
                      "src": "2016:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 25153,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2016:17:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 25154,
                  "nodeType": "ExpressionStatement",
                  "src": "2016:17:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25159,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 25155,
                      "name": "_result",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25147,
                      "src": "2039:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 25158,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 25156,
                        "name": "_a",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25142,
                        "src": "2049:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "-",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 25157,
                        "name": "_b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25144,
                        "src": "2054:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2049:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2039:17:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 25160,
                  "nodeType": "ExpressionStatement",
                  "src": "2039:17:82"
                }
              ]
            },
            "documentation": "@notice Returns result of two safely-subtracted integers\n @dev Uses `safeToSubtract` internally; throws if unsafe\n @param _a Integer to subtract from\n @param _b Integer to subtract\n @return _result Result of subtraction",
            "id": 25162,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "subtract",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 25145,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25142,
                  "name": "_a",
                  "nodeType": "VariableDeclaration",
                  "scope": 25162,
                  "src": "1916:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25141,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1916:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25144,
                  "name": "_b",
                  "nodeType": "VariableDeclaration",
                  "scope": 25162,
                  "src": "1928:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25143,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1928:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1915:24:82"
            },
            "payable": false,
            "returnParameters": {
              "id": 25148,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25147,
                  "name": "_result",
                  "nodeType": "VariableDeclaration",
                  "scope": 25162,
                  "src": "1994:12:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25146,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1994:4:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1993:14:82"
            },
            "scope": 25197,
            "src": "1898:163:82",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 25195,
              "nodeType": "Block",
              "src": "6924:234:82",
              "statements": [
                {
                  "assignments": [
                    25174
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 25174,
                      "name": "_weight_times_fee_per_unit",
                      "nodeType": "VariableDeclaration",
                      "scope": 25196,
                      "src": "6930:34:82",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 25173,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "6930:7:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 25178,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 25177,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 25175,
                      "name": "_asset_weight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25164,
                      "src": "6967:13:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "*",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 25176,
                      "name": "_fee_per_unit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25168,
                      "src": "6983:13:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "6967:29:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6930:66:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 25184,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 25182,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 25180,
                            "name": "_weight_times_fee_per_unit",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 25174,
                            "src": "7010:26:82",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 25181,
                            "name": "_asset_weight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 25164,
                            "src": "7039:13:82",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7010:42:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 25183,
                          "name": "_fee_per_unit",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25168,
                          "src": "7056:13:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "7010:59:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 25179,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        26185,
                        26186
                      ],
                      "referencedDeclaration": 26185,
                      "src": "7002:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 25185,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7002:68:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 25186,
                  "nodeType": "ExpressionStatement",
                  "src": "7002:68:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25191,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 25187,
                      "name": "_recast_fee",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25171,
                      "src": "7076:11:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 25190,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 25188,
                        "name": "_weight_times_fee_per_unit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25174,
                        "src": "7090:26:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 25189,
                        "name": "_unit_size",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25166,
                        "src": "7119:10:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7090:39:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7076:53:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 25192,
                  "nodeType": "ExpressionStatement",
                  "src": "7076:53:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25193,
                    "name": "_recast_fee",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 25171,
                    "src": "7142:11:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 25172,
                  "id": 25194,
                  "nodeType": "Return",
                  "src": "7135:18:82"
                }
              ]
            },
            "documentation": "DEPRECATED\n# @notice Calculate Transaction Fee\n# paramm _sending_amount The amount being sent\n# paramm _unit_size The minimum amount that can be sent\n# paramm _fee_per_unit The fee per unit\n# @return _tx_fee The transaction fee due",
            "id": 25196,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calculate_recast_fee",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 25169,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25164,
                  "name": "_asset_weight",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6781:21:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25163,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6781:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25166,
                  "name": "_unit_size",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6804:18:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25165,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6804:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25168,
                  "name": "_fee_per_unit",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6824:21:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25167,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6824:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6780:66:82"
            },
            "payable": false,
            "returnParameters": {
              "id": 25172,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25171,
                  "name": "_recast_fee",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6901:19:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25170,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6901:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6900:21:82"
            },
            "scope": 25197,
            "src": "6751:407:82",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "public"
          }
        ],
        "scope": 25198,
        "src": "81:7080:82"
      }
    ],
    "src": "0:7162:82"
  },
  "legacyAST": {
    "absolutePath": "@digix/solidity-core-libraries/contracts/MathUtils.sol",
    "exportedSymbols": {
      "MathUtils": [
        25197
      ]
    },
    "id": 25198,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 25118,
        "literals": [
          "solidity",
          "^",
          "0.4",
          ".19"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:82"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": "@title Digix Math Library\n @author DigixGlobal",
        "fullyImplemented": true,
        "id": 25197,
        "linearizedBaseContracts": [
          25197
        ],
        "name": "MathUtils",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": {
              "id": 25139,
              "nodeType": "Block",
              "src": "1133:55:82",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25131,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 25127,
                      "name": "_result",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25125,
                      "src": "1139:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 25130,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 25128,
                        "name": "_a",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25120,
                        "src": "1149:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 25129,
                        "name": "_b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25122,
                        "src": "1154:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "1149:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1139:17:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 25132,
                  "nodeType": "ExpressionStatement",
                  "src": "1139:17:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 25136,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 25134,
                          "name": "_result",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25125,
                          "src": "1170:7:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 25135,
                          "name": "_a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25120,
                          "src": "1180:2:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1170:12:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 25133,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        26185,
                        26186
                      ],
                      "referencedDeclaration": 26185,
                      "src": "1162:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 25137,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1162:21:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 25138,
                  "nodeType": "ExpressionStatement",
                  "src": "1162:21:82"
                }
              ]
            },
            "documentation": "@notice Returns sum of two safely-added integers\n @dev Uses `safeToAdd` internally; throws if unsafe\n @param _a Integer to add\n @param _b Integer to add\n @return _result Sum of inputs",
            "id": 25140,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "add",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 25123,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25120,
                  "name": "_a",
                  "nodeType": "VariableDeclaration",
                  "scope": 25140,
                  "src": "1036:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25119,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1036:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25122,
                  "name": "_b",
                  "nodeType": "VariableDeclaration",
                  "scope": 25140,
                  "src": "1048:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25121,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1048:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1035:24:82"
            },
            "payable": false,
            "returnParameters": {
              "id": 25126,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25125,
                  "name": "_result",
                  "nodeType": "VariableDeclaration",
                  "scope": 25140,
                  "src": "1114:15:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25124,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1114:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1113:17:82"
            },
            "scope": 25197,
            "src": "1023:165:82",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 25161,
              "nodeType": "Block",
              "src": "2010:51:82",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 25152,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 25150,
                          "name": "_a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25142,
                          "src": "2024:2:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 25151,
                          "name": "_b",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25144,
                          "src": "2030:2:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2024:8:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 25149,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        26185,
                        26186
                      ],
                      "referencedDeclaration": 26185,
                      "src": "2016:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 25153,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2016:17:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 25154,
                  "nodeType": "ExpressionStatement",
                  "src": "2016:17:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25159,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 25155,
                      "name": "_result",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25147,
                      "src": "2039:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 25158,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 25156,
                        "name": "_a",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25142,
                        "src": "2049:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "-",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 25157,
                        "name": "_b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25144,
                        "src": "2054:2:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2049:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2039:17:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 25160,
                  "nodeType": "ExpressionStatement",
                  "src": "2039:17:82"
                }
              ]
            },
            "documentation": "@notice Returns result of two safely-subtracted integers\n @dev Uses `safeToSubtract` internally; throws if unsafe\n @param _a Integer to subtract from\n @param _b Integer to subtract\n @return _result Result of subtraction",
            "id": 25162,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "subtract",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 25145,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25142,
                  "name": "_a",
                  "nodeType": "VariableDeclaration",
                  "scope": 25162,
                  "src": "1916:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25141,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1916:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25144,
                  "name": "_b",
                  "nodeType": "VariableDeclaration",
                  "scope": 25162,
                  "src": "1928:10:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25143,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1928:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1915:24:82"
            },
            "payable": false,
            "returnParameters": {
              "id": 25148,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25147,
                  "name": "_result",
                  "nodeType": "VariableDeclaration",
                  "scope": 25162,
                  "src": "1994:12:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25146,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1994:4:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1993:14:82"
            },
            "scope": 25197,
            "src": "1898:163:82",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 25195,
              "nodeType": "Block",
              "src": "6924:234:82",
              "statements": [
                {
                  "assignments": [
                    25174
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 25174,
                      "name": "_weight_times_fee_per_unit",
                      "nodeType": "VariableDeclaration",
                      "scope": 25196,
                      "src": "6930:34:82",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 25173,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "6930:7:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 25178,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 25177,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 25175,
                      "name": "_asset_weight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25164,
                      "src": "6967:13:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "*",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 25176,
                      "name": "_fee_per_unit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25168,
                      "src": "6983:13:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "6967:29:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6930:66:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 25184,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 25182,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 25180,
                            "name": "_weight_times_fee_per_unit",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 25174,
                            "src": "7010:26:82",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 25181,
                            "name": "_asset_weight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 25164,
                            "src": "7039:13:82",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7010:42:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 25183,
                          "name": "_fee_per_unit",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 25168,
                          "src": "7056:13:82",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "7010:59:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 25179,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        26185,
                        26186
                      ],
                      "referencedDeclaration": 26185,
                      "src": "7002:7:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 25185,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7002:68:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 25186,
                  "nodeType": "ExpressionStatement",
                  "src": "7002:68:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25191,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 25187,
                      "name": "_recast_fee",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 25171,
                      "src": "7076:11:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 25190,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 25188,
                        "name": "_weight_times_fee_per_unit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25174,
                        "src": "7090:26:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 25189,
                        "name": "_unit_size",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 25166,
                        "src": "7119:10:82",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7090:39:82",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7076:53:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 25192,
                  "nodeType": "ExpressionStatement",
                  "src": "7076:53:82"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 25193,
                    "name": "_recast_fee",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 25171,
                    "src": "7142:11:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 25172,
                  "id": 25194,
                  "nodeType": "Return",
                  "src": "7135:18:82"
                }
              ]
            },
            "documentation": "DEPRECATED\n# @notice Calculate Transaction Fee\n# paramm _sending_amount The amount being sent\n# paramm _unit_size The minimum amount that can be sent\n# paramm _fee_per_unit The fee per unit\n# @return _tx_fee The transaction fee due",
            "id": 25196,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calculate_recast_fee",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 25169,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25164,
                  "name": "_asset_weight",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6781:21:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25163,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6781:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25166,
                  "name": "_unit_size",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6804:18:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25165,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6804:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 25168,
                  "name": "_fee_per_unit",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6824:21:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25167,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6824:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6780:66:82"
            },
            "payable": false,
            "returnParameters": {
              "id": 25172,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25171,
                  "name": "_recast_fee",
                  "nodeType": "VariableDeclaration",
                  "scope": 25196,
                  "src": "6901:19:82",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 25170,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "6901:7:82",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6900:21:82"
            },
            "scope": 25197,
            "src": "6751:407:82",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "public"
          }
        ],
        "scope": 25198,
        "src": "81:7080:82"
      }
    ],
    "src": "0:7162:82"
  },
  "compiler": {
    "name": "solc",
    "version": "0.4.25+commit.59dbf8f1.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "2.0.2",
  "updatedAt": "2020-03-13T02:38:46.158Z"
}