UNPKG

@ethsub/sol

Version:
1,034 lines (1,033 loc) 160 kB
{ "contractName": "ERC1155Safe", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"ChainSafe Systems.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"Manages deposited ERC1155s.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This contract is intended to be used with ERC1155Handler contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/ERC1155Safe.sol\":\"ERC1155Safe\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"keccak256\":\"0x4fc155a2f7837603d69a13cfa481eb5e7f5e02cb77e2ec9edbac30986db37988\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0855147e38b5e36288a8df73b8da49132f14ec7abb19041b0c98872263643aaa\",\"dweb:/ipfs/QmSrSysyFUYQq7hbJaJXG7EyZW6ezDBzEJx3SABp6eiJSS\"]},\"@openzeppelin/contracts/introspection/ERC165.sol\":{\"keccak256\":\"0x24141d2f6b98d4cb77a8936eae8cbaad2e261d9062bdc08036096f4550092501\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b710eb003944777135f027500a5a57b479fe857849f5f467c1ef9687401e3c95\",\"dweb:/ipfs/QmcELzi6KRzAs3DXwxdsoKWRJ13KSeipKQsJgD3unctdZM\"]},\"@openzeppelin/contracts/introspection/IERC165.sol\":{\"keccak256\":\"0xf70bc25d981e4ec9673a995ad2995d5d493ea188d3d8f388bba9c227ce09fb82\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd970f51e3a77790c2f02b5b1759827c3b897c3d98c407b3631e8af32e3dc93c\",\"dweb:/ipfs/QmPF85Amgbqjk3SNZKsPCsqCw8JfwYEPMnnhvMJUyX58je\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://526dc85e1f9b9b45830e202568d267d93dde7a4fcccf4ad7798dadcd92304d3c\",\"dweb:/ipfs/QmaoXMB972J3cSDLtBq3xBo4jLwqD2uzXTwujtSPqkYVhR\"]},\"@openzeppelin/contracts/presets/ERC1155PresetMinterPauser.sol\":{\"keccak256\":\"0x79d54b5a31d16734efb0f8951be2c981e92c5ef80999bc8ad79b0f2b69fea91f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://de8115cb549358e059328ea901ade257d2b6a5ed7b58b667c948b65c54593ecf\",\"dweb:/ipfs/QmPY5T994PemFwQ99Z1xH21ahRWKqy6NhkidgEGfUn4r9J\"]},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"keccak256\":\"0x3fef0eeb248c7109ce0f9adce59543d8b4141b78382d3ec34db33dabdbbc13f9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f704e6539b9db8b7bf08b8a1c1cb2b44519129b5659211ed5af8f2aa5f264a2f\",\"dweb:/ipfs/QmYRPbn7p8oTEKNUrd7YMMA2J8W6vUeFmCcCMGvyWdZ6UB\"]},\"@openzeppelin/contracts/token/ERC1155/ERC1155Burnable.sol\":{\"keccak256\":\"0xa5e68c47511b26ea2f0e8ad00e6121e6ce135e9c3f969ff0819e59f0d1ceb1f6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c39be775bd739707cd4d1e026d6a8d60cd8876dd09547dc3ca9d9c672a03a429\",\"dweb:/ipfs/QmU3pp23qk3y6ByyWsoyeiQUW5X5rVnTQAafcsogfbZqta\"]},\"@openzeppelin/contracts/token/ERC1155/ERC1155Pausable.sol\":{\"keccak256\":\"0xaa7e99ee0555145c0a6ff8a6e8fdf4ed338c0a32bb14edfeb680bf70e0125e64\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://92ccfe042c80623e56d4801e9c49c3b615334907dd767ec44be8623da0417b13\",\"dweb:/ipfs/QmWZVFpFjT42LTjAzf2UNR4sHAdsoxRhxvS1RkEKrVNmGn\"]},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"keccak256\":\"0x61321d2c86346045bf394885ee3afeecc65f9daad2694bc19110967588fd7b5d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1703b877203e0447ede72dcf73f1c4f2089b415bd1c44877904128a64fafed5b\",\"dweb:/ipfs/QmaZoYDo2FWtKcwCc9zuabU6zri8KV9xJrhU614d93sLid\"]},\"@openzeppelin/contracts/token/ERC1155/IERC1155MetadataURI.sol\":{\"keccak256\":\"0xd918cca1b659f588a6d12d05fd7196179a8b1eac9133d7f77da7ef3133e13256\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7c75d578f42e2e2e427b934e6c41cc759be2d0a52155868308e915328c8feb2b\",\"dweb:/ipfs/QmbFNHtWAoNhe82Hy6yKTePWJRczqzp1APSBfLS9XfAN6e\"]},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"keccak256\":\"0x2690a9b7f4f7489b8d25a4fc6bffc02ec3971fb41ed6c8b59adef2833bdab07c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8148c99452b6793ac9599abdc8bdaf4eeb47f34590beea8aa01089be14e2990c\",\"dweb:/ipfs/QmNdenmZ4EDfH9TuBas3pHeGuZvDNo2rsfgUj6ka8vuH37\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://256c8c8af5eb072bc473226ab2b2187149b8fc04f5f4a4820db22527f5ce8e3c\",\"dweb:/ipfs/QmRvi5BhnL7Rxf85KrJhwM6RRhukm4tzoctRdgQEheNyiN\"]},\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ded47ec7c96750f9bd04bbbc84f659992d4ba901cb7b532a52cd468272cf378f\",\"dweb:/ipfs/QmfBrGtQP7rZEqEg6Wz6jh2N2Kukpj1z5v3CGWmAqrzm96\"]},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4580d57781513d98870d9738c7d39094336e0a70cdb90d68dad549c6ced466ec\",\"dweb:/ipfs/Qmf9YZzzRFuvMnav9dgmeRUpdYMMECiZX8w25sHWVbA18V\"]},\"@openzeppelin/contracts/utils/Pausable.sol\":{\"keccak256\":\"0x212fb1b1d4beaf74354dad9bc329f44ee3c5375ef1c32acff76b4ecefc10f1d8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d21c68cb321d1c8d0fa39fd9ecb6bbe3b2f26623b0f38af280a010c916c85f23\",\"dweb:/ipfs/Qmf2P51HRC4ekDHLYfbXu5SXR33gXrWtq6oKSmfyWqVRuC\"]},\"project:/contracts/ERC1155Safe.sol\":{\"keccak256\":\"0x4992c04bc61e9181e3124e88168ee96479af3141d995bd3f73cc5bb87fc9826a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5feedec64963becffdec51d27afb9af379ac6417ebf6151623ed75ffa09c4a88\",\"dweb:/ipfs/QmXgT6imAPCsrsvEGmNqEc6QytPduV71Xe9cnKjsrT9Er5\"]}},\"version\":1}", "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212209ee253238797f12d852314f137163946800d5e28239b9235eec8b37a1cf6b7e364736f6c634300060c0033", "deployedBytecode": "0x6080604052600080fdfea26469706673582212209ee253238797f12d852314f137163946800d5e28239b9235eec8b37a1cf6b7e364736f6c634300060c0033", "immutableReferences": {}, "sourceMap": "478:2553:36:-:0;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "478:2553:36:-:0;;;;;", "source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.6.12;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/ERC1155Burnable.sol\";\nimport \"@openzeppelin/contracts/presets/ERC1155PresetMinterPauser.sol\";\n\n/**\n @title Manages deposited ERC1155s.\n @author ChainSafe Systems.\n @notice This contract is intended to be used with ERC1155Handler contract.\n */\ncontract ERC1155Safe {\n using SafeMath for uint256;\n\n /**\n @notice Used to gain custoday of deposited token with batching.\n @param tokenAddress Address of ERC1155 to transfer.\n @param owner Address of current token owner.\n @param recipient Address to transfer token to.\n @param tokenIDs IDs of tokens to transfer.\n @param amounts Amounts of tokens to transfer.\n @param data Additional data.\n */\n function lockBatchERC1155(address tokenAddress, address owner, address recipient, uint[] memory tokenIDs, uint[] memory amounts, bytes memory data) internal {\n IERC1155 erc1155 = IERC1155(tokenAddress);\n erc1155.safeBatchTransferFrom(owner, recipient, tokenIDs, amounts, data);\n }\n\n /**\n @notice Transfers custody of token to recipient with batching.\n @param tokenAddress Address of ERC1155 to transfer.\n @param owner Address of current token owner.\n @param recipient Address to transfer token to.\n @param tokenIDs IDs of tokens to transfer.\n @param amounts Amounts of tokens to transfer.\n @param data Additional data.\n */\n function releaseBatchERC1155(address tokenAddress, address owner, address recipient, uint256[] memory tokenIDs, uint[] memory amounts, bytes memory data) internal {\n IERC1155 erc1155 = IERC1155(tokenAddress);\n erc1155.safeBatchTransferFrom(owner, recipient, tokenIDs, amounts, data);\n }\n\n /**\n @notice Used to create new ERC1155s with batching.\n @param tokenAddress Address of ERC1155 to mint.\n @param recipient Address to mint token to.\n @param tokenIDs IDs of tokens to mint.\n @param amounts Amounts of token to mint.\n @param data Additional data.\n */\n function mintBatchERC1155(address tokenAddress, address recipient, uint[] memory tokenIDs, uint[] memory amounts, bytes memory data) internal {\n ERC1155PresetMinterPauser erc1155 = ERC1155PresetMinterPauser(tokenAddress);\n erc1155.mintBatch(recipient, tokenIDs, amounts, data);\n }\n\n /**\n @notice Used to burn ERC1155s with batching.\n @param tokenAddress Address of ERC1155 to burn.\n @param tokenIDs IDs of tokens to burn.\n @param amounts Amounts of tokens to burn.\n */\n function burnBatchERC1155(address tokenAddress, address owner, uint[] memory tokenIDs, uint[] memory amounts) internal {\n ERC1155Burnable erc1155 = ERC1155Burnable(tokenAddress);\n erc1155.burnBatch(owner, tokenIDs, amounts);\n }\n}\n", "sourcePath": "/home/sigo/w/deer/ethsub/packages/sol/contracts/ERC1155Safe.sol", "ast": { "absolutePath": "project:/contracts/ERC1155Safe.sol", "exportedSymbols": { "ERC1155Safe": [ 7526 ] }, "id": 7527, "license": "LGPL-3.0-only", "nodeType": "SourceUnit", "nodes": [ { "id": 7386, "literals": [ "solidity", "0.6", ".12" ], "nodeType": "PragmaDirective", "src": "42:23:36" }, { "absolutePath": "@openzeppelin/contracts/math/SafeMath.sol", "file": "@openzeppelin/contracts/math/SafeMath.sol", "id": 7387, "nodeType": "ImportDirective", "scope": 7527, "sourceUnit": 938, "src": "67:51:36", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@openzeppelin/contracts/token/ERC1155/IERC1155.sol", "file": "@openzeppelin/contracts/token/ERC1155/IERC1155.sol", "id": 7388, "nodeType": "ImportDirective", "scope": 7527, "sourceUnit": 2587, "src": "119:60:36", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@openzeppelin/contracts/token/ERC1155/ERC1155Burnable.sol", "file": "@openzeppelin/contracts/token/ERC1155/ERC1155Burnable.sol", "id": 7389, "nodeType": "ImportDirective", "scope": 7527, "sourceUnit": 2332, "src": "180:67:36", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@openzeppelin/contracts/presets/ERC1155PresetMinterPauser.sol", "file": "@openzeppelin/contracts/presets/ERC1155PresetMinterPauser.sol", "id": 7390, "nodeType": "ImportDirective", "scope": 7527, "sourceUnit": 1119, "src": "248:71:36", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 7391, "nodeType": "StructuredDocumentation", "src": "321:156:36", "text": "@title Manages deposited ERC1155s.\n@author ChainSafe Systems.\n@notice This contract is intended to be used with ERC1155Handler contract." }, "fullyImplemented": true, "id": 7526, "linearizedBaseContracts": [ 7526 ], "name": "ERC1155Safe", "nodeType": "ContractDefinition", "nodes": [ { "id": 7394, "libraryName": { "contractScope": null, "id": 7392, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 937, "src": "511:8:36", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$937", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "505:27:36", "typeName": { "id": 7393, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "524:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "body": { "id": 7428, "nodeType": "Block", "src": "1093:140:36", "statements": [ { "assignments": [ 7413 ], "declarations": [ { "constant": false, "id": 7413, "mutability": "mutable", "name": "erc1155", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7428, "src": "1103:16:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" }, "typeName": { "contractScope": null, "id": 7412, "name": "IERC1155", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2586, "src": "1103:8:36", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" } }, "value": null, "visibility": "internal" } ], "id": 7417, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 7415, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7397, "src": "1131:12:36", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 7414, "name": "IERC1155", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2586, "src": "1122:8:36", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC1155_$2586_$", "typeString": "type(contract IERC1155)" } }, "id": 7416, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1122:22:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" } }, "nodeType": "VariableDeclarationStatement", "src": "1103:41:36" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 7421, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7399, "src": "1184:5:36", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 7422, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7401, "src": "1191:9:36", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 7423, "name": "tokenIDs", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7404, "src": "1202:8:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } }, { "argumentTypes": null, "id": 7424, "name": "amounts", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7407, "src": "1212:7:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } }, { "argumentTypes": null, "id": 7425, "name": "data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7409, "src": "1221:4:36", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" }, { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" }, { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "expression": { "argumentTypes": null, "id": 7418, "name": "erc1155", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7413, "src": "1154:7:36", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" } }, "id": 7420, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeBatchTransferFrom", "nodeType": "MemberAccess", "referencedDeclaration": 2585, "src": "1154:29:36", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_bytes_memory_ptr_$returns$__$", "typeString": "function (address,address,uint256[] memory,uint256[] memory,bytes memory) external" } }, "id": 7426, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1154:72:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 7427, "nodeType": "ExpressionStatement", "src": "1154:72:36" } ] }, "documentation": { "id": 7395, "nodeType": "StructuredDocumentation", "src": "538:393:36", "text": "@notice Used to gain custoday of deposited token with batching.\n@param tokenAddress Address of ERC1155 to transfer.\n@param owner Address of current token owner.\n@param recipient Address to transfer token to.\n@param tokenIDs IDs of tokens to transfer.\n@param amounts Amounts of tokens to transfer.\n@param data Additional data." }, "id": 7429, "implemented": true, "kind": "function", "modifiers": [], "name": "lockBatchERC1155", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 7410, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7397, "mutability": "mutable", "name": "tokenAddress", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7429, "src": "962:20:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 7396, "name": "address", "nodeType": "ElementaryTypeName", "src": "962:7:36", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7399, "mutability": "mutable", "name": "owner", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7429, "src": "984:13:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 7398, "name": "address", "nodeType": "ElementaryTypeName", "src": "984:7:36", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7401, "mutability": "mutable", "name": "recipient", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7429, "src": "999:17:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 7400, "name": "address", "nodeType": "ElementaryTypeName", "src": "999:7:36", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7404, "mutability": "mutable", "name": "tokenIDs", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7429, "src": "1018:22:36", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[]" }, "typeName": { "baseType": { "id": 7402, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1018:4:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 7403, "length": null, "nodeType": "ArrayTypeName", "src": "1018:6:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7407, "mutability": "mutable", "name": "amounts", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7429, "src": "1042:21:36", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[]" }, "typeName": { "baseType": { "id": 7405, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1042:4:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 7406, "length": null, "nodeType": "ArrayTypeName", "src": "1042:6:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7409, "mutability": "mutable", "name": "data", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7429, "src": "1065:17:36", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 7408, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1065:5:36", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "961:122:36" }, "returnParameters": { "id": 7411, "nodeType": "ParameterList", "parameters": [], "src": "1093:0:36" }, "scope": 7526, "src": "936:297:36", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" }, { "body": { "id": 7463, "nodeType": "Block", "src": "1799:140:36", "statements": [ { "assignments": [ 7448 ], "declarations": [ { "constant": false, "id": 7448, "mutability": "mutable", "name": "erc1155", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7463, "src": "1809:16:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" }, "typeName": { "contractScope": null, "id": 7447, "name": "IERC1155", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2586, "src": "1809:8:36", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" } }, "value": null, "visibility": "internal" } ], "id": 7452, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 7450, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7432, "src": "1837:12:36", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 7449, "name": "IERC1155", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2586, "src": "1828:8:36", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC1155_$2586_$", "typeString": "type(contract IERC1155)" } }, "id": 7451, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1828:22:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" } }, "nodeType": "VariableDeclarationStatement", "src": "1809:41:36" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 7456, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7434, "src": "1890:5:36", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 7457, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7436, "src": "1897:9:36", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 7458, "name": "tokenIDs", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7439, "src": "1908:8:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } }, { "argumentTypes": null, "id": 7459, "name": "amounts", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7442, "src": "1918:7:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } }, { "argumentTypes": null, "id": 7460, "name": "data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7444, "src": "1927:4:36", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" }, { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" }, { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "expression": { "argumentTypes": null, "id": 7453, "name": "erc1155", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7448, "src": "1860:7:36", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC1155_$2586", "typeString": "contract IERC1155" } }, "id": 7455, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeBatchTransferFrom", "nodeType": "MemberAccess", "referencedDeclaration": 2585, "src": "1860:29:36", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_bytes_memory_ptr_$returns$__$", "typeString": "function (address,address,uint256[] memory,uint256[] memory,bytes memory) external" } }, "id": 7461, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1860:72:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 7462, "nodeType": "ExpressionStatement", "src": "1860:72:36" } ] }, "documentation": { "id": 7430, "nodeType": "StructuredDocumentation", "src": "1239:392:36", "text": "@notice Transfers custody of token to recipient with batching.\n@param tokenAddress Address of ERC1155 to transfer.\n@param owner Address of current token owner.\n@param recipient Address to transfer token to.\n@param tokenIDs IDs of tokens to transfer.\n@param amounts Amounts of tokens to transfer.\n@param data Additional data." }, "id": 7464, "implemented": true, "kind": "function", "modifiers": [], "name": "releaseBatchERC1155", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 7445, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7432, "mutability": "mutable", "name": "tokenAddress", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7464, "src": "1665:20:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 7431, "name": "address", "nodeType": "ElementaryTypeName", "src": "1665:7:36", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7434, "mutability": "mutable", "name": "owner", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7464, "src": "1687:13:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 7433, "name": "address", "nodeType": "ElementaryTypeName", "src": "1687:7:36", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7436, "mutability": "mutable", "name": "recipient", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7464, "src": "1702:17:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 7435, "name": "address", "nodeType": "ElementaryTypeName", "src": "1702:7:36", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7439, "mutability": "mutable", "name": "tokenIDs", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7464, "src": "1721:25:36", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[]" }, "typeName": { "baseType": { "id": 7437, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1721:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 7438, "length": null, "nodeType": "ArrayTypeName", "src": "1721:9:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7442, "mutability": "mutable", "name": "amounts", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7464, "src": "1748:21:36", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[]" }, "typeName": { "baseType": { "id": 7440, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1748:4:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 7441, "length": null, "nodeType": "ArrayTypeName", "src": "1748:6:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 7444, "mutability": "mutable", "name": "data", "nodeType": "VariableDeclaration", "overrides": null, "scope": 7464, "src": "1771:17:36", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 7443, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1771:5:36", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1664:125:36" }, "returnParameters": { "id": 7446, "nodeType": "ParameterList",