{
  "contractName": "SafeTransfer",
  "abi": [],
  "metadata": "{\"compiler\":{\"version\":\"0.5.4+commit.9549d8ff\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@gnosis.pm/dx-contracts/contracts/base/SafeTransfer.sol\":\"SafeTransfer\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/dx-contracts/contracts/base/SafeTransfer.sol\":{\"keccak256\":\"0x7f461fead59c4a6f4b0026a3cc9d1ace254da72e0ab3ce5f9bc561aecf97c76b\",\"urls\":[\"bzzr://1ea5e2f07f8f4bda73dab84dca1ac64b8e7a743df02224d73b48cf6c3db83845\"]},\"@gnosis.pm/util-contracts/contracts/Token.sol\":{\"keccak256\":\"0x364778f634c900ed83553e17ef1284bd33fa68a738e668f664b4a0fa675bb586\",\"urls\":[\"bzzr://cb31caaf3364dbf5d688adb10de074284845b142c26d23a47b09ee510dd4a432\"]}},\"version\":1}",
  "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3fe6080604052600080fdfea165627a7a723058206f8424e9c345ed1651196123d2e288f27864f1118c9115b08c0a527fc44f60b00029",
  "deployedBytecode": "0x6080604052600080fdfea165627a7a723058206f8424e9c345ed1651196123d2e288f27864f1118c9115b08c0a527fc44f60b00029",
  "sourceMap": "236:945:69:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;236:945:69;;;;;;;",
  "deployedSourceMap": "236:945:69:-;;;;;",
  "source": "pragma solidity ^0.5.0;\n\nimport \"@gnosis.pm/util-contracts/contracts/Token.sol\";\n\ninterface BadToken {\n    function transfer(address to, uint value) external;\n    function transferFrom(address from, address to, uint value) external;\n}\n\ncontract SafeTransfer {\n    function safeTransfer(address token, address to, uint value, bool from) internal returns (bool result) {\n        if (from) {\n            BadToken(token).transferFrom(msg.sender, address(this), value);\n        } else {\n            BadToken(token).transfer(to, value);\n        }\n\n        // solium-disable-next-line security/no-inline-assembly\n        assembly {\n            switch returndatasize\n                case 0 {\n                    // This is our BadToken\n                    result := not(0) // result is true\n                }\n                case 32 {\n                    // This is our GoodToken\n                    returndatacopy(0, 0, 32)\n                    result := mload(0) // result == returndata of external call\n                }\n                default {\n                    // This is not an ERC20 token\n                    result := 0\n                }\n        }\n        return result;\n    }\n}\n",
  "sourcePath": "@gnosis.pm/dx-contracts/contracts/base/SafeTransfer.sol",
  "ast": {
    "absolutePath": "@gnosis.pm/dx-contracts/contracts/base/SafeTransfer.sol",
    "exportedSymbols": {
      "BadToken": [
        19710
      ],
      "SafeTransfer": [
        19752
      ]
    },
    "id": 19753,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 19692,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:23:69"
      },
      {
        "absolutePath": "@gnosis.pm/util-contracts/contracts/Token.sol",
        "file": "@gnosis.pm/util-contracts/contracts/Token.sol",
        "id": 19693,
        "nodeType": "ImportDirective",
        "scope": 19753,
        "sourceUnit": 22513,
        "src": "25:55:69",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": null,
        "fullyImplemented": false,
        "id": 19710,
        "linearizedBaseContracts": [
          19710
        ],
        "name": "BadToken",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": null,
            "documentation": null,
            "id": 19700,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "transfer",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19698,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19695,
                  "name": "to",
                  "nodeType": "VariableDeclaration",
                  "scope": 19700,
                  "src": "125:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19694,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "125:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19697,
                  "name": "value",
                  "nodeType": "VariableDeclaration",
                  "scope": 19700,
                  "src": "137:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 19696,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "137:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "124:24:69"
            },
            "returnParameters": {
              "id": 19699,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "157:0:69"
            },
            "scope": 19710,
            "src": "107:51:69",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 19709,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "transferFrom",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19707,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19702,
                  "name": "from",
                  "nodeType": "VariableDeclaration",
                  "scope": 19709,
                  "src": "185:12:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19701,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "185:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19704,
                  "name": "to",
                  "nodeType": "VariableDeclaration",
                  "scope": 19709,
                  "src": "199:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19703,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "199:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19706,
                  "name": "value",
                  "nodeType": "VariableDeclaration",
                  "scope": 19709,
                  "src": "211:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 19705,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "211:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "184:38:69"
            },
            "returnParameters": {
              "id": 19708,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "231:0:69"
            },
            "scope": 19710,
            "src": "163:69:69",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          }
        ],
        "scope": 19753,
        "src": "82:152:69"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "contract",
        "documentation": null,
        "fullyImplemented": true,
        "id": 19752,
        "linearizedBaseContracts": [
          19752
        ],
        "name": "SafeTransfer",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": {
              "id": 19750,
              "nodeType": "Block",
              "src": "367:812:69",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "id": 19723,
                    "name": "from",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 19718,
                    "src": "381:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 19745,
                    "nodeType": "Block",
                    "src": "480:60:69",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 19741,
                              "name": "to",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 19714,
                              "src": "519:2:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 19742,
                              "name": "value",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 19716,
                              "src": "523:5:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 19738,
                                  "name": "token",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 19712,
                                  "src": "503:5:69",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                ],
                                "id": 19737,
                                "name": "BadToken",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 19710,
                                "src": "494:8:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_BadToken_$19710_$",
                                  "typeString": "type(contract BadToken)"
                                }
                              },
                              "id": 19739,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "494:15:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_BadToken_$19710",
                                "typeString": "contract BadToken"
                              }
                            },
                            "id": 19740,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "transfer",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 19700,
                            "src": "494:24:69",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
                              "typeString": "function (address,uint256) external"
                            }
                          },
                          "id": 19743,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "494:35:69",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 19744,
                        "nodeType": "ExpressionStatement",
                        "src": "494:35:69"
                      }
                    ]
                  },
                  "id": 19746,
                  "nodeType": "IfStatement",
                  "src": "377:163:69",
                  "trueBody": {
                    "id": 19736,
                    "nodeType": "Block",
                    "src": "387:87:69",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 19728,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 23690,
                                "src": "430:3:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 19729,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "430:10:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 19731,
                                  "name": "this",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 23782,
                                  "src": "450:4:69",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_SafeTransfer_$19752",
                                    "typeString": "contract SafeTransfer"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_contract$_SafeTransfer_$19752",
                                    "typeString": "contract SafeTransfer"
                                  }
                                ],
                                "id": 19730,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "lValueRequested": false,
                                "nodeType": "ElementaryTypeNameExpression",
                                "src": "442:7:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_address_$",
                                  "typeString": "type(address)"
                                },
                                "typeName": "address"
                              },
                              "id": 19732,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "442:13:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 19733,
                              "name": "value",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 19716,
                              "src": "457:5:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              },
                              {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 19725,
                                  "name": "token",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 19712,
                                  "src": "410:5:69",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                ],
                                "id": 19724,
                                "name": "BadToken",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 19710,
                                "src": "401:8:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_BadToken_$19710_$",
                                  "typeString": "type(contract BadToken)"
                                }
                              },
                              "id": 19726,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "401:15:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_BadToken_$19710",
                                "typeString": "contract BadToken"
                              }
                            },
                            "id": 19727,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "transferFrom",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 19709,
                            "src": "401:28:69",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
                              "typeString": "function (address,address,uint256) external"
                            }
                          },
                          "id": 19734,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "401:62:69",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 19735,
                        "nodeType": "ExpressionStatement",
                        "src": "401:62:69"
                      }
                    ]
                  }
                },
                {
                  "externalReferences": [
                    {
                      "result": {
                        "declaration": 19721,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "748:6:69",
                        "valueSize": 1
                      }
                    },
                    {
                      "result": {
                        "declaration": 19721,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1111:6:69",
                        "valueSize": 1
                      }
                    },
                    {
                      "result": {
                        "declaration": 19721,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "937:6:69",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 19747,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    switch returndatasize()\n    case 0 {\n        result := not(0)\n    }\n    case 32 {\n        returndatacopy(0, 0, 32)\n        result := mload(0)\n    }\n    default {\n        result := 0\n    }\n}",
                  "src": "614:551:69"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 19748,
                    "name": "result",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 19721,
                    "src": "1166:6:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 19722,
                  "id": 19749,
                  "nodeType": "Return",
                  "src": "1159:13:69"
                }
              ]
            },
            "documentation": null,
            "id": 19751,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "safeTransfer",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19719,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19712,
                  "name": "token",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "286:13:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19711,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "286:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19714,
                  "name": "to",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "301:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19713,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "301:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19716,
                  "name": "value",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "313:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 19715,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "313:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19718,
                  "name": "from",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "325:9:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 19717,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "325:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "285:50:69"
            },
            "returnParameters": {
              "id": 19722,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19721,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "354:11:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 19720,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "354:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "353:13:69"
            },
            "scope": 19752,
            "src": "264:915:69",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 19753,
        "src": "236:945:69"
      }
    ],
    "src": "0:1182:69"
  },
  "legacyAST": {
    "absolutePath": "@gnosis.pm/dx-contracts/contracts/base/SafeTransfer.sol",
    "exportedSymbols": {
      "BadToken": [
        19710
      ],
      "SafeTransfer": [
        19752
      ]
    },
    "id": 19753,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 19692,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:23:69"
      },
      {
        "absolutePath": "@gnosis.pm/util-contracts/contracts/Token.sol",
        "file": "@gnosis.pm/util-contracts/contracts/Token.sol",
        "id": 19693,
        "nodeType": "ImportDirective",
        "scope": 19753,
        "sourceUnit": 22513,
        "src": "25:55:69",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": null,
        "fullyImplemented": false,
        "id": 19710,
        "linearizedBaseContracts": [
          19710
        ],
        "name": "BadToken",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": null,
            "documentation": null,
            "id": 19700,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "transfer",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19698,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19695,
                  "name": "to",
                  "nodeType": "VariableDeclaration",
                  "scope": 19700,
                  "src": "125:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19694,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "125:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19697,
                  "name": "value",
                  "nodeType": "VariableDeclaration",
                  "scope": 19700,
                  "src": "137:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 19696,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "137:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "124:24:69"
            },
            "returnParameters": {
              "id": 19699,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "157:0:69"
            },
            "scope": 19710,
            "src": "107:51:69",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 19709,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "transferFrom",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19707,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19702,
                  "name": "from",
                  "nodeType": "VariableDeclaration",
                  "scope": 19709,
                  "src": "185:12:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19701,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "185:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19704,
                  "name": "to",
                  "nodeType": "VariableDeclaration",
                  "scope": 19709,
                  "src": "199:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19703,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "199:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19706,
                  "name": "value",
                  "nodeType": "VariableDeclaration",
                  "scope": 19709,
                  "src": "211:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 19705,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "211:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "184:38:69"
            },
            "returnParameters": {
              "id": 19708,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "231:0:69"
            },
            "scope": 19710,
            "src": "163:69:69",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          }
        ],
        "scope": 19753,
        "src": "82:152:69"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "contract",
        "documentation": null,
        "fullyImplemented": true,
        "id": 19752,
        "linearizedBaseContracts": [
          19752
        ],
        "name": "SafeTransfer",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": {
              "id": 19750,
              "nodeType": "Block",
              "src": "367:812:69",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "id": 19723,
                    "name": "from",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 19718,
                    "src": "381:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 19745,
                    "nodeType": "Block",
                    "src": "480:60:69",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 19741,
                              "name": "to",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 19714,
                              "src": "519:2:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 19742,
                              "name": "value",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 19716,
                              "src": "523:5:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 19738,
                                  "name": "token",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 19712,
                                  "src": "503:5:69",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                ],
                                "id": 19737,
                                "name": "BadToken",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 19710,
                                "src": "494:8:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_BadToken_$19710_$",
                                  "typeString": "type(contract BadToken)"
                                }
                              },
                              "id": 19739,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "494:15:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_BadToken_$19710",
                                "typeString": "contract BadToken"
                              }
                            },
                            "id": 19740,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "transfer",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 19700,
                            "src": "494:24:69",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
                              "typeString": "function (address,uint256) external"
                            }
                          },
                          "id": 19743,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "494:35:69",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 19744,
                        "nodeType": "ExpressionStatement",
                        "src": "494:35:69"
                      }
                    ]
                  },
                  "id": 19746,
                  "nodeType": "IfStatement",
                  "src": "377:163:69",
                  "trueBody": {
                    "id": 19736,
                    "nodeType": "Block",
                    "src": "387:87:69",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 19728,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 23690,
                                "src": "430:3:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 19729,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "430:10:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 19731,
                                  "name": "this",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 23782,
                                  "src": "450:4:69",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_SafeTransfer_$19752",
                                    "typeString": "contract SafeTransfer"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_contract$_SafeTransfer_$19752",
                                    "typeString": "contract SafeTransfer"
                                  }
                                ],
                                "id": 19730,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "lValueRequested": false,
                                "nodeType": "ElementaryTypeNameExpression",
                                "src": "442:7:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_address_$",
                                  "typeString": "type(address)"
                                },
                                "typeName": "address"
                              },
                              "id": 19732,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "442:13:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 19733,
                              "name": "value",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 19716,
                              "src": "457:5:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              },
                              {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 19725,
                                  "name": "token",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 19712,
                                  "src": "410:5:69",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                ],
                                "id": 19724,
                                "name": "BadToken",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 19710,
                                "src": "401:8:69",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_BadToken_$19710_$",
                                  "typeString": "type(contract BadToken)"
                                }
                              },
                              "id": 19726,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "401:15:69",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_BadToken_$19710",
                                "typeString": "contract BadToken"
                              }
                            },
                            "id": 19727,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "transferFrom",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 19709,
                            "src": "401:28:69",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
                              "typeString": "function (address,address,uint256) external"
                            }
                          },
                          "id": 19734,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "401:62:69",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 19735,
                        "nodeType": "ExpressionStatement",
                        "src": "401:62:69"
                      }
                    ]
                  }
                },
                {
                  "externalReferences": [
                    {
                      "result": {
                        "declaration": 19721,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "748:6:69",
                        "valueSize": 1
                      }
                    },
                    {
                      "result": {
                        "declaration": 19721,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1111:6:69",
                        "valueSize": 1
                      }
                    },
                    {
                      "result": {
                        "declaration": 19721,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "937:6:69",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 19747,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    switch returndatasize()\n    case 0 {\n        result := not(0)\n    }\n    case 32 {\n        returndatacopy(0, 0, 32)\n        result := mload(0)\n    }\n    default {\n        result := 0\n    }\n}",
                  "src": "614:551:69"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 19748,
                    "name": "result",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 19721,
                    "src": "1166:6:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 19722,
                  "id": 19749,
                  "nodeType": "Return",
                  "src": "1159:13:69"
                }
              ]
            },
            "documentation": null,
            "id": 19751,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "safeTransfer",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19719,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19712,
                  "name": "token",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "286:13:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19711,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "286:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19714,
                  "name": "to",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "301:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 19713,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "301:7:69",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19716,
                  "name": "value",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "313:10:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 19715,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "313:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 19718,
                  "name": "from",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "325:9:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 19717,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "325:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "285:50:69"
            },
            "returnParameters": {
              "id": 19722,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 19721,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 19751,
                  "src": "354:11:69",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 19720,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "354:4:69",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "353:13:69"
            },
            "scope": 19752,
            "src": "264:915:69",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 19753,
        "src": "236:945:69"
      }
    ],
    "src": "0:1182:69"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.4+commit.9549d8ff.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.9",
  "updatedAt": "2019-05-28T21:12:52.472Z",
  "devdoc": {
    "methods": {}
  },
  "userdoc": {
    "methods": {}
  }
}