UNPKG

@vporton/future-contracts

Version:

Ethereum accounts bid on future financing (essentially, transfer money from the future) - smart contracts

1,145 lines 1.01 MB
{ "contractName": "Lock", "abi": [ { "inputs": [ { "internalType": "string", "name": "_uri", "type": "string" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "contract IERC1155", "name": "contractAddress", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "collateralTokenId", "type": "uint256" }, { "indexed": true, "internalType": "uint64", "name": "oracleId", "type": "uint64" }, { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "CollateralWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "customer", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "condition", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "ConditionCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "contract IERC1155", "name": "collateralContractAddress", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "collateralTokenId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "DonateCollateral", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": false, "internalType": "uint64", "name": "oracleId", "type": "uint64" } ], "name": "OracleCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint64", "name": "oracleId", "type": "uint64" } ], "name": "OracleFinished", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "oracleOwner", "type": "address" }, { "indexed": true, "internalType": "uint64", "name": "oracleId", "type": "uint64" } ], "name": "OracleOwnerChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint64", "name": "oracleId", "type": "uint64" }, { "components": [ { "internalType": "contract IERC1155", "name": "contractAddress", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "indexed": true, "internalType": "struct Lock.ERC1155Token", "name": "token", "type": "tuple" } ], "name": "OracleToken", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" } ], "name": "TransferBatch", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "id", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "TransferSingle", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "value", "type": "string" }, { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "URI", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "accounts", "type": "address[]" }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" } ], "name": "balanceOfBatch", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_newOracleOwner", "type": "address" }, { "internalType": "uint64", "name": "_oracleId", "type": "uint64" } ], "name": "changeOracleOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "contract IERC1155", "name": "_collateralContractAddress", "type": "address" }, { "internalType": "uint256", "name": "_collateralTokenId", "type": "uint256" }, { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "uint256", "name": "_condition", "type": "uint256" }, { "internalType": "address", "name": "_user", "type": "address" } ], "name": "collateralOwing", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "conditionOwners", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "contract IERC1155", "name": "_collateralContractAddress", "type": "address" }, { "internalType": "uint256", "name": "_collateralTokenId", "type": "uint256" }, { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "donate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "name": "externalConditionals", "outputs": [ { "internalType": "contract IERC1155", "name": "contractAddress", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "contract IERC1155", "name": "_collateralContractAddress", "type": "address" }, { "internalType": "uint256", "name": "_collateralTokenId", "type": "uint256" }, { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "gatherDeFiProfit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_oracleId", "type": "uint64" } ], "name": "gracePeriodEnd", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_condition", "type": "uint256" } ], "name": "isConditionalLocked", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "name": "isOracleFinished", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "lastCollateralBalanceFirstRoundMap", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "lastCollateralBalanceSecondRoundMap", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxConditionId", "outputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxOracleId", "outputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "onERC1155BatchReceived", "outputs": [ { "internalType": "bytes4", "name": "", "type": "bytes4" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "onERC1155Received", "outputs": [ { "internalType": "bytes4", "name": "", "type": "bytes4" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "onERC721Received", "outputs": [ { "internalType": "bytes4", "name": "", "type": "bytes4" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_oracleId", "type": "uint64" } ], "name": "oracleOwner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256[]", "name": "_ids", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "_values", "type": "uint256[]" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeBatchTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_id", "type": "uint256" }, { "internalType": "uint256", "name": "_value", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "uint256", "name": "_time", "type": "uint256" } ], "name": "updateGracePeriodEnds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "uri", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "name": "usersWithdrewInFirstRound", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "contract IERC1155", "name": "_collateralContractAddress", "type": "address" }, { "internalType": "uint256", "name": "_collateralTokenId", "type": "uint256" }, { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "uint256", "name": "_condition", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "withdrawCollateral", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_oracleOwner", "type": "address" }, { "components": [ { "internalType": "contract IERC1155", "name": "contractAddress", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "internalType": "struct Lock.ERC1155Token", "name": "_token", "type": "tuple" } ], "name": "createOracle", "outputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "uint256", "name": "_conditionalTokenId", "type": "uint256" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "mintConditional", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint64", "name": "_oracleId", "type": "uint64" }, { "internalType": "uint256", "name": "_conditionalTokenId", "type": "uint256" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "burnConditional", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC1155\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"collateralTokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"oracleId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"CollateralWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"customer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"condition\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ConditionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC1155\",\"name\":\"collateralContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"collateralTokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"DonateCollateral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oracleId\",\"type\":\"uint64\"}],\"name\":\"OracleCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"oracleId\",\"type\":\"uint64\"}],\"name\":\"OracleFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracleOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"oracleId\",\"type\":\"uint64\"}],\"name\":\"OracleOwnerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"oracleId\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"contract IERC1155\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"indexed\":true,\"internalType\":\"struct Lock.ERC1155Token\",\"name\":\"token\",\"type\":\"tuple\"}],\"name\":\"OracleToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_conditionalTokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"burnConditional\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOracleOwner\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"}],\"name\":\"changeOracleOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC1155\",\"name\":\"_collateralContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_collateralTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_condition\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"}],\"name\":\"collateralOwing\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"conditionOwners\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_oracleOwner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IERC1155\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"internalType\":\"struct Lock.ERC1155Token\",\"name\":\"_token\",\"type\":\"tuple\"}],\"name\":\"createOracle\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC1155\",\"name\":\"_collateralContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_collateralTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"donate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"externalConditionals\",\"outputs\":[{\"internalType\":\"contract IERC1155\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC1155\",\"name\":\"_collateralContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_collateralTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"gatherDeFiProfit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"}],\"name\":\"gracePeriodEnd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_condition\",\"type\":\"uint256\"}],\"name\":\"isConditionalLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"isOracleFinished\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastCollateralBalanceFirstRoundMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastCollateralBalanceSecondRoundMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxConditionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxOracleId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_conditionalTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"mintConditional\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"}],\"name\":\"oracleOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"_ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_time\",\"type\":\"uint256\"}],\"name\":\"updateGracePeriodEnds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"usersWithdrewInFirstRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC1155\",\"name\":\"_collateralContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_collateralTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_oracleId\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_condition\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"withdrawCollateral\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Victor Porton\",\"events\":{\"OracleToken(uint64,(address,uint256))\":{\"params\":{\"oracleId\":\"The oracle ID.\",\"token\":\"The token.\"}}},\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.\"},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"burnConditional(uint64,uint256,address,uint256,bytes)\":{\"params\":{\"_amount\":\"The minted amount.\",\"_conditionalTokenId\":\"The conditional token ID.\",\"_data\":\"Additional data.\",\"_oracleId\":\"The oracle ID.\",\"_to\":\"The token recepient.\"}},\"changeOracleOwner(address,uint64)\":{\"params\":{\"_newOracleOwner\":\"New owner.\",\"_oracleId\":\"The oracle whose owner to change.\"}},\"collateralOwing(address,uint256,uint64,uint256,address)\":{\"params\":{\"_collateralContractAddress\":\"The ERC-1155 collateral token contract.\",\"_collateralTokenId\":\"The ERC-1155 collateral token ID.\",\"_condition\":\"The condition (the original receiver of a conditional token).\",\"_oracleId\":\"From which oracle's \\\"account\\\" to withdraw.\",\"_user\":\"The user to which we may owe.\"}},\"constructor\":{\"params\":{\"_uri\":\"The ERC-1155 token URI.\"}},\"donate(address,uint256,uint64,uint256,address,address,bytes)\":{\"params\":{\"_amount\":\"The amount to donate.\",\"_collateralContractAddress\":\"The collateral ERC-1155 contract address.\",\"_collateralTokenId\":\"The collateral ERC-1155 token ID.\",\"_data\":\"Additional transaction data.\",\"_from\":\"From whom to take the donation.\",\"_oracleId\":\"The oracle ID to whose ecosystem to donate to.\",\"_to\":\"On whose account the donation amount is assigned.\"}},\"gatherDeFiProfit(address,uint256,uint64,bytes)\":{\"params\":{\"_collateralContractAddress\":\"The collateral ERC-1155 contract address.\",\"_collateralTokenId\":\"The collateral ERC-1155 token ID.\",\"_data\":\"Additional transaction data.\",\"_oracleId\":\"The oracle ID to whose ecosystem to donate to.\"}},\"gracePeriodEnd(uint64)\":{\"params\":{\"_oracleId\":\"For which oracle.\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC1155-isApprovedForAll}.\"},\"isConditionalLocked(address,uint256)\":{\"params\":{\"_condition\":\"The condition (the original receiver of a conditional token).\",\"_user\":\"Querying if locked for this user.\"}},\"mintConditional(uint64,uint256,uint256,bytes)\":{\"params\":{\"_amount\":\"The minted amount.\",\"_conditionalTokenId\":\"The conditional token ID.\",\"_data\":\"Additional data.\",\"_oracleId\":\"The oracle ID.\"}},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.\"},\"oracleOwner(uint64)\":{\"params\":{\"_oracleId\":\"The oracle ID.\"}},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC1155-setApprovalForAll}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}. Time complexity O(1), guaranteed to always use less than 30 000 gas.\"},\"totalSupply(uint256)\":{\"params\":{\"id\":\"Token ID.\"},\"returns\":{\"_0\":\"Total supply.\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"},\"withdrawCollateral(address,uint256,uint64,uint256,bytes)\":{\"params\":{\"_collateralContractAddress\":\"The ERC-1155 collateral token contract.\",\"_collateralTokenId\":\"The ERC-1155 collateral token ID.\",\"_condition\":\"The condition.\",\"_data\":\"Additional data. Notes: - It is made impossible to withdraw somebody's other collateral, as otherwise we can't mark non-active accounts in grace period. - We can't transfer to somebody other than `msg.sender` because anybody can transfer (needed for multi-level transfers). - After this function is called, it becomes impossible to transfer the corresponding conditional token of `msg.sender` (to prevent its repeated withdrawal).\",\"_oracleId\":\"From which oracle's \\\"account\\\" to withdraw.\"}}},\"title\":\"Locking a token for a collateral.\",\"version\":1},\"userdoc\":{\"events\":{\"CollateralWithdrawn(address,uint256,uint64,address,uint256)\":{\"notice\":\"Emitted when collateral is withdrawn.\"},\"ConditionCreated(address,address,uint256,bytes)\":{\"notice\":\"Emitted when an oracle owner is set.\"},\"DonateCollateral(address,uint256,address,uint256,address,bytes)\":{\"notice\":\"Emitted when a collateral is donated.\"},\"OracleCreated(address,uint64)\":{\"notice\":\"Emitted when an oracle is created.\"},\"OracleFinished(uint64)\":{\"notice\":\"Emitted when an oracle is marked as having finished its work.\"},\"OracleOwnerChanged(address,uint64)\":{\"notice\":\"Emitted when an oracle owner is set.\"},\"OracleToken(uint64,(address,uint256))\":{\"notice\":\"Assign a token to an orcle\"}},\"kind\":\"user\",\"methods\":{\"burnConditional(uint64,uint256,address,uint256,bytes)\":{\"notice\":\"Burn a conditional token\"},\"changeOracleOwner(address,uint64)\":{\"notice\":\"Modify the owner of an oracle.\"},\"collateralOwing(address,uint256,uint64,uint256,address)\":{\"notice\":\"Calculate how much collateral is owed to a user.\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createOracle(address,(address,uint256))\":{\"notice\":\"Create a new oracle\"},\"donate(address,uint256,uint64,uint256,address,address,bytes)\":{\"notice\":\"Donate funds in an ERC-1155 token. First, the collateral token need to be approved to be spent by this contract from the address `_from`. It also mints a token (with a different ID), that counts donations in that token.\"},\"externalConditionals(uint64)\":{\"notice\":\"Mapping (oracleId => external conditional token).\"},\"gatherDeFiProfit(address,uint256,uint64,bytes)\":{\"notice\":\"Gather a DeFi profit of a token previous donated to this contact.\"},\"gracePeriodEnd(uint64)\":{\"notice\":\"Retrieve the end of the grace period.\"},\"isConditionalLocked(address,uint256)\":{\"notice\":\"Are transfers of a conditinal token locked? This is used to prevent its repeated withdrawal.\"},\"isOracleFinished(uint64)\":{\"notice\":\"Is the oracle marked as having finished its work? `oracleId` is the oracle ID.\"},\"mintConditional(uint64,uint256,uint256,bytes)\":{\"notice\":\"Mint a conditional token\"},\"oracleOwner(uint64)\":{\"notice\":\"Get the oracle owner.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"notice\":\"An ERC-1155 function. We disallow transfers of conditional tokens after redeem `_to` prevent \\\"gathering\\\" them before redeeming each oracle.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"notice\":\"An ERC-1155 function. We disallow transfers of conditional tokens after redeem `_to` prevent \\\"gathering\\\" them before redeeming each oracle.\"},\"totalSupply(uint256)\":{\"notice\":\"Total supply of a token (conforms to `IERC1155Views`).\"},\"updateGracePeriodEnds(uint64,uint256)\":{\"notice\":\"Set the end time of the grace period. The first withdrawal can be done *only* during the grace period. The second withdrawal can be done after the end of the grace period and only if the first withdrawal was done. The intention of the grace period is to check which of users are active (\\\"alive\\\").\"},\"usersWithdrewInFirstRound(uint64)\":{\"notice\":\"Mapping (oracleId => amount user withdrew in first round) (see `docs/Calculations.md`).\"},\"withdrawCollateral(address,uint256,uint64,uint256,bytes)\":{\"notice\":\"Transfer to `msg.sender` the collateral ERC-1155 token. The amount transferred is proportional to the score of `_condition` by the oracle.\"}},\"notice\":\"Not audited, not enough tested. Lock a token to exchange it for a collateral in the future. We have only one condition ID: `0`. TODO: This contract is somehow gas-inefficient. Should we release it?\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/user/Projects/future-contracts/contracts/Lock.sol\":\"Lock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"/home/user/Projects/future-contracts/contracts/BaseLock.sol\":{\"keccak256\":\"0x477edfd8178110507dd44a101ec4d45bd82e073a8441c30062a9ca3cc3742184\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://0188608bd813e9e1de9472d2c71264fa24655ec646cc59be93d56a648fab1c6c\",\"dweb:/ipfs/QmdERM9oNEvHgmes3AWG8zAyx4ueAFKtXGsegAfXUKryDW\"]},\"/home/user/Projects/future-contracts/contracts/ERC1155/ERC1155.sol\":{\"keccak256\":\"0x7dcdf324fd4d2dec68846958865ae833956cb4ad80cd83cf6f107e7c33500bf6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5cddf52afd931cbf983100a0415f04e6646aa90d100fd91437d2a75e3b241206\",\"dweb:/ipfs/QmXXJ2qoC1rSsKdg5s87m3BPQ3RFGw2rNrNv7KygzGJ9zQ\"]},\"/home/user/Projects/future-contracts/contracts/ERC1155/ERC1155WithTotals.sol\":{\"keccak256\":\"0x1d5fcf7a70d6f5dcd4ddf25caece633a9b4d17154fb98b5fc9a5ae4600b2d