{
  "contractName": "SafeERC20",
  "abi": [],
  "metadata": "{\"compiler\":{\"version\":\"0.4.24+commit.e67f0147\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/erc/SafeERC20.sol\":\"SafeERC20\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/erc/SafeERC20.sol\":{\"keccak256\":\"0x028b5ed3a8e362a108a095120ab5d87bb477834bc45a9627b3592e2fe0cddd5e\",\"urls\":[\"bzzr://9be226bd300adfbe60e61f25e15dd798e04f6ef8580c41284812cc44c341cfa7\"]}},\"version\":1}",
  "bytecode": "0x605a602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a265627a7a72305820cbe747a2b109bc8d4e52febc7a21320b76c7cb068d4500350858fd4920ee4fab6c6578706572696d656e74616cf50037",
  "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a265627a7a72305820cbe747a2b109bc8d4e52febc7a21320b76c7cb068d4500350858fd4920ee4fab6c6578706572696d656e74616cf50037",
  "sourceMap": "351:1647:2:-;;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": "351:1647:2:-;;;;;;;;",
  "source": "pragma solidity >=0.4.24;\npragma experimental ABIEncoderV2;\n\n/**\n对ERC20的一个包装，实现ERC20的合约很多，但是存在一些不合规的合约，\n在转账完成后没有正确的返回一个布尔值表示成功或者失败。\nSafeERC20通过对返回值的检测，补足返回值，尤其是在合约里操作ERC20时建议使用\n */\nlibrary SafeERC20 {\n  function isContract(address addr) internal view {\n    assembly {\n      if iszero(extcodesize(addr)) {\n        revert(0, 0)\n      }\n    }\n  }\n\n  function handleReturnData(address _erc20Addr, bytes memory _msg)\n    internal\n    returns (bool result)\n  {\n    uint256 msgSize = _msg.length;\n    assembly {\n      if iszero(\n        call(gas(), _erc20Addr, 0, add(_msg, 0x20), msgSize, 0x00, 0x20)\n      ) {\n        revert(0, 0)\n      }\n      switch returndatasize()\n        case 0 {\n          // not a std erc20\n          result := 1\n        }\n        case 32 {\n          // std erc20\n          returndatacopy(0, 0, 32)\n          result := mload(0)\n        }\n        default {\n          // anything else, should revert for safety\n          revert(0, 0)\n        }\n    }\n  }\n\n  function safeTransfer(\n    address _erc20Addr,\n    address _to,\n    uint256 _value\n  ) internal returns (bool result) {\n    // Must be a contract addr first!\n    isContract(_erc20Addr);\n\n    bytes memory _msg =\n      abi.encodeWithSignature(\"transfer(address,uint256)\", _to, _value);\n\n    // handle returndata\n    return handleReturnData(_erc20Addr, _msg);\n  }\n\n  function safeTransferFrom(\n    address _erc20Addr,\n    address _from,\n    address _to,\n    uint256 _value\n  ) internal returns (bool result) {\n    // Must be a contract addr first!\n    isContract(_erc20Addr);\n\n    // call return false when something wrong\n    bytes memory _msg =\n      abi.encodeWithSignature(\n        \"transferFrom(address,address,uint256)\",\n        _from,\n        _to,\n        _value\n      );\n\n    // handle returndata\n    return handleReturnData(_erc20Addr, _msg);\n  }\n}\n",
  "sourcePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/erc/SafeERC20.sol",
  "ast": {
    "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/erc/SafeERC20.sol",
    "exportedSymbols": {
      "SafeERC20": [
        784
      ]
    },
    "id": 785,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 696,
        "literals": [
          "solidity",
          ">=",
          "0.4",
          ".24"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:25:2"
      },
      {
        "id": 697,
        "literals": [
          "experimental",
          "ABIEncoderV2"
        ],
        "nodeType": "PragmaDirective",
        "src": "26:33:2"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": "对ERC20的一个包装，实现ERC20的合约很多，但是存在一些不合规的合约，\n在转账完成后没有正确的返回一个布尔值表示成功或者失败。\nSafeERC20通过对返回值的检测，补足返回值，尤其是在合约里操作ERC20时建议使用",
        "fullyImplemented": true,
        "id": 784,
        "linearizedBaseContracts": [
          784
        ],
        "name": "SafeERC20",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": {
              "id": 703,
              "nodeType": "Block",
              "src": "421:92:2",
              "statements": [
                {
                  "externalReferences": [
                    {
                      "addr": {
                        "declaration": 699,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "466:4:2",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 702,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    if iszero(extcodesize(addr))\n    {\n        revert(0, 0)\n    }\n}",
                  "src": "427:86:2"
                }
              ]
            },
            "documentation": null,
            "id": 704,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "isContract",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 700,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 699,
                  "name": "addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 704,
                  "src": "393:12:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 698,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "393:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "392:14:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 701,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "421:0:2"
            },
            "scope": 784,
            "src": "373:140:2",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 719,
              "nodeType": "Block",
              "src": "623:517:2",
              "statements": [
                {
                  "assignments": [
                    714
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 714,
                      "name": "msgSize",
                      "nodeType": "VariableDeclaration",
                      "scope": 720,
                      "src": "629:15:2",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 713,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "629:7:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 717,
                  "initialValue": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 715,
                      "name": "_msg",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 708,
                      "src": "647:4:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes memory"
                      }
                    },
                    "id": 716,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "length",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": null,
                    "src": "647:11:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "629:29:2"
                },
                {
                  "externalReferences": [
                    {
                      "result": {
                        "declaration": 711,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "890:6:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "_erc20Addr": {
                        "declaration": 706,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "712:10:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "msgSize": {
                        "declaration": 714,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "744:7:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "_msg": {
                        "declaration": 708,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "731:4:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "result": {
                        "declaration": 711,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "998:6:2",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 718,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    if iszero(call(gas(), _erc20Addr, 0, add(_msg, 0x20), msgSize, 0x00, 0x20))\n    {\n        revert(0, 0)\n    }\n    switch returndatasize()\n    case 0 {\n        result := 1\n    }\n    case 32 {\n        returndatacopy(0, 0, 32)\n        result := mload(0)\n    }\n    default {\n        revert(0, 0)\n    }\n}",
                  "src": "664:476:2"
                }
              ]
            },
            "documentation": null,
            "id": 720,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": false,
            "modifiers": [],
            "name": "handleReturnData",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 709,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 706,
                  "name": "_erc20Addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 720,
                  "src": "543:18:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 705,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "543:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 708,
                  "name": "_msg",
                  "nodeType": "VariableDeclaration",
                  "scope": 720,
                  "src": "563:17:2",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 707,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "563:5:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "542:39:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 712,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 711,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 720,
                  "src": "608:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 710,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "608:4:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "607:13:2"
            },
            "scope": 784,
            "src": "517:623:2",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 749,
              "nodeType": "Block",
              "src": "1262:242:2",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 732,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 722,
                        "src": "1317:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 731,
                      "name": "isContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 704,
                      "src": "1306:10:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_address_$returns$__$",
                        "typeString": "function (address) view"
                      }
                    },
                    "id": 733,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1306:22:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 734,
                  "nodeType": "ExpressionStatement",
                  "src": "1306:22:2"
                },
                {
                  "assignments": [
                    736
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 736,
                      "name": "_msg",
                      "nodeType": "VariableDeclaration",
                      "scope": 750,
                      "src": "1335:17:2",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 735,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1335:5:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 743,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "7472616e7366657228616464726573732c75696e7432353629",
                        "id": 739,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1385:27:2",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
                          "typeString": "literal_string \"transfer(address,uint256)\""
                        },
                        "value": "transfer(address,uint256)"
                      },
                      {
                        "argumentTypes": null,
                        "id": 740,
                        "name": "_to",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 724,
                        "src": "1414:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 741,
                        "name": "_value",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 726,
                        "src": "1419:6:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
                          "typeString": "literal_string \"transfer(address,uint256)\""
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 737,
                        "name": "abi",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 9028,
                        "src": "1361:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_magic_abi",
                          "typeString": "abi"
                        }
                      },
                      "id": 738,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "lValueRequested": false,
                      "memberName": "encodeWithSignature",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1361:23:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$",
                        "typeString": "function (string memory) pure returns (bytes memory)"
                      }
                    },
                    "id": 742,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1361:65:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory_ptr",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1335:91:2"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 745,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 722,
                        "src": "1482:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 746,
                        "name": "_msg",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 736,
                        "src": "1494:4:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 744,
                      "name": "handleReturnData",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 720,
                      "src": "1465:16:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$",
                        "typeString": "function (address,bytes memory) returns (bool)"
                      }
                    },
                    "id": 747,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1465:34:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 730,
                  "id": 748,
                  "nodeType": "Return",
                  "src": "1458:41:2"
                }
              ]
            },
            "documentation": null,
            "id": 750,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": false,
            "modifiers": [],
            "name": "safeTransfer",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 727,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 722,
                  "name": "_erc20Addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1171:18:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 721,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1171:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 724,
                  "name": "_to",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1195:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 723,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1195:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 726,
                  "name": "_value",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1212:14:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 725,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1212:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1165:65:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 730,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 729,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1249:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 728,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1249:4:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1248:13:2"
            },
            "scope": 784,
            "src": "1144:360:2",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 782,
              "nodeType": "Block",
              "src": "1649:347:2",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 764,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 752,
                        "src": "1704:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 763,
                      "name": "isContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 704,
                      "src": "1693:10:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_address_$returns$__$",
                        "typeString": "function (address) view"
                      }
                    },
                    "id": 765,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1693:22:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 766,
                  "nodeType": "ExpressionStatement",
                  "src": "1693:22:2"
                },
                {
                  "assignments": [
                    768
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 768,
                      "name": "_msg",
                      "nodeType": "VariableDeclaration",
                      "scope": 783,
                      "src": "1768:17:2",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 767,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1768:5:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 776,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "7472616e7366657246726f6d28616464726573732c616464726573732c75696e7432353629",
                        "id": 771,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1827:39:2",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
                          "typeString": "literal_string \"transferFrom(address,address,uint256)\""
                        },
                        "value": "transferFrom(address,address,uint256)"
                      },
                      {
                        "argumentTypes": null,
                        "id": 772,
                        "name": "_from",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 754,
                        "src": "1876:5:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 773,
                        "name": "_to",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 756,
                        "src": "1891:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 774,
                        "name": "_value",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 758,
                        "src": "1904:6:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
                          "typeString": "literal_string \"transferFrom(address,address,uint256)\""
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 769,
                        "name": "abi",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 9028,
                        "src": "1794:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_magic_abi",
                          "typeString": "abi"
                        }
                      },
                      "id": 770,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "lValueRequested": false,
                      "memberName": "encodeWithSignature",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1794:23:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$",
                        "typeString": "function (string memory) pure returns (bytes memory)"
                      }
                    },
                    "id": 775,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1794:124:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory_ptr",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1768:150:2"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 778,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 752,
                        "src": "1974:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 779,
                        "name": "_msg",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 768,
                        "src": "1986:4:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 777,
                      "name": "handleReturnData",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 720,
                      "src": "1957:16:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$",
                        "typeString": "function (address,bytes memory) returns (bool)"
                      }
                    },
                    "id": 780,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1957:34:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 762,
                  "id": 781,
                  "nodeType": "Return",
                  "src": "1950:41:2"
                }
              ]
            },
            "documentation": null,
            "id": 783,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": false,
            "modifiers": [],
            "name": "safeTransferFrom",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 759,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 752,
                  "name": "_erc20Addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1539:18:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 751,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1539:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 754,
                  "name": "_from",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1563:13:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 753,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1563:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 756,
                  "name": "_to",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1582:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 755,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1582:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 758,
                  "name": "_value",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1599:14:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 757,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1599:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1533:84:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 762,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 761,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1636:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 760,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1636:4:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1635:13:2"
            },
            "scope": 784,
            "src": "1508:488:2",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 785,
        "src": "351:1647:2"
      }
    ],
    "src": "0:1999:2"
  },
  "legacyAST": {
    "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/erc/SafeERC20.sol",
    "exportedSymbols": {
      "SafeERC20": [
        784
      ]
    },
    "id": 785,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 696,
        "literals": [
          "solidity",
          ">=",
          "0.4",
          ".24"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:25:2"
      },
      {
        "id": 697,
        "literals": [
          "experimental",
          "ABIEncoderV2"
        ],
        "nodeType": "PragmaDirective",
        "src": "26:33:2"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": "对ERC20的一个包装，实现ERC20的合约很多，但是存在一些不合规的合约，\n在转账完成后没有正确的返回一个布尔值表示成功或者失败。\nSafeERC20通过对返回值的检测，补足返回值，尤其是在合约里操作ERC20时建议使用",
        "fullyImplemented": true,
        "id": 784,
        "linearizedBaseContracts": [
          784
        ],
        "name": "SafeERC20",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "body": {
              "id": 703,
              "nodeType": "Block",
              "src": "421:92:2",
              "statements": [
                {
                  "externalReferences": [
                    {
                      "addr": {
                        "declaration": 699,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "466:4:2",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 702,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    if iszero(extcodesize(addr))\n    {\n        revert(0, 0)\n    }\n}",
                  "src": "427:86:2"
                }
              ]
            },
            "documentation": null,
            "id": 704,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "isContract",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 700,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 699,
                  "name": "addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 704,
                  "src": "393:12:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 698,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "393:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "392:14:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 701,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "421:0:2"
            },
            "scope": 784,
            "src": "373:140:2",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 719,
              "nodeType": "Block",
              "src": "623:517:2",
              "statements": [
                {
                  "assignments": [
                    714
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 714,
                      "name": "msgSize",
                      "nodeType": "VariableDeclaration",
                      "scope": 720,
                      "src": "629:15:2",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 713,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "629:7:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 717,
                  "initialValue": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 715,
                      "name": "_msg",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 708,
                      "src": "647:4:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes memory"
                      }
                    },
                    "id": 716,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "length",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": null,
                    "src": "647:11:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "629:29:2"
                },
                {
                  "externalReferences": [
                    {
                      "result": {
                        "declaration": 711,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "890:6:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "_erc20Addr": {
                        "declaration": 706,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "712:10:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "msgSize": {
                        "declaration": 714,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "744:7:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "_msg": {
                        "declaration": 708,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "731:4:2",
                        "valueSize": 1
                      }
                    },
                    {
                      "result": {
                        "declaration": 711,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "998:6:2",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 718,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    if iszero(call(gas(), _erc20Addr, 0, add(_msg, 0x20), msgSize, 0x00, 0x20))\n    {\n        revert(0, 0)\n    }\n    switch returndatasize()\n    case 0 {\n        result := 1\n    }\n    case 32 {\n        returndatacopy(0, 0, 32)\n        result := mload(0)\n    }\n    default {\n        revert(0, 0)\n    }\n}",
                  "src": "664:476:2"
                }
              ]
            },
            "documentation": null,
            "id": 720,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": false,
            "modifiers": [],
            "name": "handleReturnData",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 709,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 706,
                  "name": "_erc20Addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 720,
                  "src": "543:18:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 705,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "543:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 708,
                  "name": "_msg",
                  "nodeType": "VariableDeclaration",
                  "scope": 720,
                  "src": "563:17:2",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 707,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "563:5:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "542:39:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 712,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 711,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 720,
                  "src": "608:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 710,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "608:4:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "607:13:2"
            },
            "scope": 784,
            "src": "517:623:2",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 749,
              "nodeType": "Block",
              "src": "1262:242:2",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 732,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 722,
                        "src": "1317:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 731,
                      "name": "isContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 704,
                      "src": "1306:10:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_address_$returns$__$",
                        "typeString": "function (address) view"
                      }
                    },
                    "id": 733,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1306:22:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 734,
                  "nodeType": "ExpressionStatement",
                  "src": "1306:22:2"
                },
                {
                  "assignments": [
                    736
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 736,
                      "name": "_msg",
                      "nodeType": "VariableDeclaration",
                      "scope": 750,
                      "src": "1335:17:2",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 735,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1335:5:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 743,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "7472616e7366657228616464726573732c75696e7432353629",
                        "id": 739,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1385:27:2",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
                          "typeString": "literal_string \"transfer(address,uint256)\""
                        },
                        "value": "transfer(address,uint256)"
                      },
                      {
                        "argumentTypes": null,
                        "id": 740,
                        "name": "_to",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 724,
                        "src": "1414:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 741,
                        "name": "_value",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 726,
                        "src": "1419:6:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
                          "typeString": "literal_string \"transfer(address,uint256)\""
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 737,
                        "name": "abi",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 9028,
                        "src": "1361:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_magic_abi",
                          "typeString": "abi"
                        }
                      },
                      "id": 738,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "lValueRequested": false,
                      "memberName": "encodeWithSignature",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1361:23:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$",
                        "typeString": "function (string memory) pure returns (bytes memory)"
                      }
                    },
                    "id": 742,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1361:65:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory_ptr",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1335:91:2"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 745,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 722,
                        "src": "1482:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 746,
                        "name": "_msg",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 736,
                        "src": "1494:4:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 744,
                      "name": "handleReturnData",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 720,
                      "src": "1465:16:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$",
                        "typeString": "function (address,bytes memory) returns (bool)"
                      }
                    },
                    "id": 747,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1465:34:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 730,
                  "id": 748,
                  "nodeType": "Return",
                  "src": "1458:41:2"
                }
              ]
            },
            "documentation": null,
            "id": 750,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": false,
            "modifiers": [],
            "name": "safeTransfer",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 727,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 722,
                  "name": "_erc20Addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1171:18:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 721,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1171:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 724,
                  "name": "_to",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1195:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 723,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1195:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 726,
                  "name": "_value",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1212:14:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 725,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1212:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1165:65:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 730,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 729,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 750,
                  "src": "1249:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 728,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1249:4:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1248:13:2"
            },
            "scope": 784,
            "src": "1144:360:2",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 782,
              "nodeType": "Block",
              "src": "1649:347:2",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 764,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 752,
                        "src": "1704:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 763,
                      "name": "isContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 704,
                      "src": "1693:10:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_address_$returns$__$",
                        "typeString": "function (address) view"
                      }
                    },
                    "id": 765,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1693:22:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 766,
                  "nodeType": "ExpressionStatement",
                  "src": "1693:22:2"
                },
                {
                  "assignments": [
                    768
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 768,
                      "name": "_msg",
                      "nodeType": "VariableDeclaration",
                      "scope": 783,
                      "src": "1768:17:2",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 767,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1768:5:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 776,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "7472616e7366657246726f6d28616464726573732c616464726573732c75696e7432353629",
                        "id": 771,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1827:39:2",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
                          "typeString": "literal_string \"transferFrom(address,address,uint256)\""
                        },
                        "value": "transferFrom(address,address,uint256)"
                      },
                      {
                        "argumentTypes": null,
                        "id": 772,
                        "name": "_from",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 754,
                        "src": "1876:5:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 773,
                        "name": "_to",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 756,
                        "src": "1891:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 774,
                        "name": "_value",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 758,
                        "src": "1904:6:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_stringliteral_23b872dd7302113369cda2901243429419bec145408fa8b352b3dd92b66c680b",
                          "typeString": "literal_string \"transferFrom(address,address,uint256)\""
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 769,
                        "name": "abi",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 9028,
                        "src": "1794:3:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_magic_abi",
                          "typeString": "abi"
                        }
                      },
                      "id": 770,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "lValueRequested": false,
                      "memberName": "encodeWithSignature",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1794:23:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$",
                        "typeString": "function (string memory) pure returns (bytes memory)"
                      }
                    },
                    "id": 775,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1794:124:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory_ptr",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1768:150:2"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 778,
                        "name": "_erc20Addr",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 752,
                        "src": "1974:10:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 779,
                        "name": "_msg",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 768,
                        "src": "1986:4:2",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 777,
                      "name": "handleReturnData",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 720,
                      "src": "1957:16:2",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$",
                        "typeString": "function (address,bytes memory) returns (bool)"
                      }
                    },
                    "id": 780,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1957:34:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 762,
                  "id": 781,
                  "nodeType": "Return",
                  "src": "1950:41:2"
                }
              ]
            },
            "documentation": null,
            "id": 783,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": false,
            "modifiers": [],
            "name": "safeTransferFrom",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 759,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 752,
                  "name": "_erc20Addr",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1539:18:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 751,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1539:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 754,
                  "name": "_from",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1563:13:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 753,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1563:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 756,
                  "name": "_to",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1582:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 755,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1582:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 758,
                  "name": "_value",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1599:14:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 757,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1599:7:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1533:84:2"
            },
            "payable": false,
            "returnParameters": {
              "id": 762,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 761,
                  "name": "result",
                  "nodeType": "VariableDeclaration",
                  "scope": 783,
                  "src": "1636:11:2",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 760,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1636:4:2",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1635:13:2"
            },
            "scope": 784,
            "src": "1508:488:2",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 785,
        "src": "351:1647:2"
      }
    ],
    "src": "0:1999:2"
  },
  "compiler": {
    "name": "solc",
    "version": "0.4.24+commit.e67f0147.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.16",
  "updatedAt": "2021-03-06T09:30:00.934Z",
  "devdoc": {
    "methods": {}
  },
  "userdoc": {
    "methods": {}
  }
}