wip, root panel initially works

pull/40/head
Tim Pechersky 2022-02-24 22:48:28 +00:00
rodzic a13b146fcd
commit efbe486546
47 zmienionych plików z 4663 dodań i 1310 usunięć

Wyświetl plik

@ -1,453 +0,0 @@
[
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "fullBottlePoolIds",
"type": "uint256[3]"
},
{
"internalType": "uint256[3]",
"name": "emptyBottlePoolIds",
"type": "uint256[3]"
}
],
"name": "addTerminusPools",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "bottlerController",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
}
],
"name": "drainERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bottlesCount",
"type": "uint256"
}
],
"name": "emptyBottles",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bottlesCount",
"type": "uint256"
}
],
"name": "fillBottles",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bottlesCount",
"type": "uint256"
}
],
"name": "fillEmptyBottles",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getBottleCapacities",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "getEmptyBottleInventory",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getEmptyBottlePoolIds",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getEmptyBottleSupplies",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "getFullBottleInventory",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFullBottlePoolIds",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFullBottlePrices",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFullBottleSupplies",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTerminusAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getUnimAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getVolumeByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"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": "uint256[3]",
"name": "newBottleCapacities",
"type": "uint256[3]"
}
],
"name": "setBottleCapacities",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "newEmptyBottlePoolIds",
"type": "uint256[3]"
}
],
"name": "setEmptyBottlePoolIds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "newFullBottlePoolIds",
"type": "uint256[3]"
}
],
"name": "setFullBottlePoolIds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "prices",
"type": "uint256[3]"
}
],
"name": "setFullBottlePrices",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_unimAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_terminusAddress",
"type": "address"
}
],
"name": "setUp",
"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": [],
"name": "surrenderTerminusPools",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdrawERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,26 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_contractOwner",
"type": "address"
},
{
"internalType": "address",
"name": "_diamondCutFacet",
"type": "address"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"stateMutability": "payable",
"type": "receive"
}
]

Wyświetl plik

@ -0,0 +1,84 @@
[
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "enum IDiamondCut.FacetCutAction",
"name": "action",
"type": "uint8"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"indexed": false,
"internalType": "struct IDiamondCut.FacetCut[]",
"name": "_diamondCut",
"type": "tuple[]"
},
{
"indexed": false,
"internalType": "address",
"name": "_init",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "DiamondCut",
"type": "event"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "enum IDiamondCut.FacetCutAction",
"name": "action",
"type": "uint8"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"internalType": "struct IDiamondCut.FacetCut[]",
"name": "_diamondCut",
"type": "tuple[]"
},
{
"internalType": "address",
"name": "_init",
"type": "address"
},
{
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "diamondCut",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,97 @@
[
{
"inputs": [
{
"internalType": "bytes4",
"name": "_functionSelector",
"type": "bytes4"
}
],
"name": "facetAddress",
"outputs": [
{
"internalType": "address",
"name": "facetAddress_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "facetAddresses",
"outputs": [
{
"internalType": "address[]",
"name": "facetAddresses_",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_facet",
"type": "address"
}
],
"name": "facetFunctionSelectors",
"outputs": [
{
"internalType": "bytes4[]",
"name": "facetFunctionSelectors_",
"type": "bytes4[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "facets",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"internalType": "struct IDiamondLoupe.Facet[]",
"name": "facets_",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "_interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]

Wyświetl plik

@ -1,14 +1,190 @@
[
{
"inputs": [],
"name": "bottlerController",
"outputs": [
"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": "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": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "",
"name": "operator",
"type": "address"
}
],
"name": "approveForPool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"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"
},
@ -16,77 +192,45 @@
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"name": "account",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "drainERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bottlesCount",
"type": "uint256"
}
],
"name": "emptyBottles",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bottlesCount",
"type": "uint256"
}
],
"name": "fillBottles",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bottlesCount",
"type": "uint256"
}
],
"name": "fillEmptyBottles",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getBottleCapacities",
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "uint256[3]",
"internalType": "bool",
"name": "",
"type": "uint256[3]"
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForPool",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
@ -98,138 +242,14 @@
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "getEmptyBottleInventory",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getEmptyBottlePoolIds",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getEmptyBottleSupplies",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "getFullBottleInventory",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFullBottlePoolIds",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFullBottlePrices",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFullBottleSupplies",
"outputs": [
{
"internalType": "uint256[3]",
"name": "",
"type": "uint256[3]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTerminusAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getUnimAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
},
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getVolumeByIndex",
"name": "poolOfOwnerByIndex",
"outputs": [
{
"internalType": "uint256",
@ -244,38 +264,32 @@
"inputs": [
{
"internalType": "address",
"name": "",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "",
"name": "to",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "",
"name": "ids",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "",
"name": "amounts",
"type": "uint256[]"
},
{
"internalType": "bytes",
"name": "",
"name": "data",
"type": "bytes"
}
],
"name": "onERC1155BatchReceived",
"outputs": [
{
"internalType": "bytes4",
"name": "",
"type": "bytes4"
}
],
"name": "safeBatchTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
@ -283,107 +297,31 @@
"inputs": [
{
"internalType": "address",
"name": "",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"name": "id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"name": "amount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "",
"name": "data",
"type": "bytes"
}
],
"name": "onERC1155Received",
"outputs": [
{
"internalType": "bytes4",
"name": "",
"type": "bytes4"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "newBottleCapacities",
"type": "uint256[3]"
}
],
"name": "setBottleCapacities",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "newEmptyBottlePoolIds",
"type": "uint256[3]"
}
],
"name": "setEmptyBottlePoolIds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "newFullBottlePoolIds",
"type": "uint256[3]"
}
],
"name": "setFullBottlePoolIds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[3]",
"name": "prices",
"type": "uint256[3]"
}
],
"name": "setFullBottlePrices",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolId",
"type": "uint256"
},
{
"internalType": "string",
"name": "uri",
"type": "string"
}
],
"name": "setTerminusPoolURI",
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@ -392,16 +330,16 @@
"inputs": [
{
"internalType": "address",
"name": "_unimAddress",
"name": "operator",
"type": "address"
},
{
"internalType": "address",
"name": "_terminusAddress",
"type": "address"
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "setUp",
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@ -427,27 +365,53 @@
},
{
"inputs": [],
"name": "surrenderTerminusPools",
"outputs": [],
"stateMutability": "nonpayable",
"name": "totalPools",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"name": "owner",
"type": "address"
},
}
],
"name": "totalPoolsByOwner",
"outputs": [
{
"internalType": "uint256",
"name": "amount",
"name": "",
"type": "uint256"
}
],
"name": "withdrawERC20",
"outputs": [],
"stateMutability": "nonpayable",
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
}
],
"name": "uri",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
]

Wyświetl plik

@ -0,0 +1,374 @@
[
{
"inputs": [],
"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": "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": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "approveForPool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"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": "account",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForPool",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isFixture",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "ids",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"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": "amount",
"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": "poolID",
"type": "uint256"
}
],
"name": "uri",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,326 @@
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "moonstreamController",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string"
}
],
"name": "setERC20Metadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,9 @@
[
{
"inputs": [],
"name": "init",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -1,20 +1,4 @@
[
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
@ -65,101 +49,6 @@
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
@ -212,21 +101,48 @@
"inputs": [
{
"internalType": "address",
"name": "sender",
"name": "account",
"type": "address"
},
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "transferFrom",
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
@ -261,20 +177,106 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string"
}
],
"name": "setERC20Metadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"name": "amount",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
@ -285,4 +287,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]

Wyświetl plik

@ -0,0 +1,84 @@
[
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "enum IDiamondCut.FacetCutAction",
"name": "action",
"type": "uint8"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"indexed": false,
"internalType": "struct IDiamondCut.FacetCut[]",
"name": "_diamondCut",
"type": "tuple[]"
},
{
"indexed": false,
"internalType": "address",
"name": "_init",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "DiamondCut",
"type": "event"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "enum IDiamondCut.FacetCutAction",
"name": "action",
"type": "uint8"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"internalType": "struct IDiamondCut.FacetCut[]",
"name": "_diamondCut",
"type": "tuple[]"
},
{
"internalType": "address",
"name": "_init",
"type": "address"
},
{
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "diamondCut",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,78 @@
[
{
"inputs": [
{
"internalType": "bytes4",
"name": "_functionSelector",
"type": "bytes4"
}
],
"name": "facetAddress",
"outputs": [
{
"internalType": "address",
"name": "facetAddress_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "facetAddresses",
"outputs": [
{
"internalType": "address[]",
"name": "facetAddresses_",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_facet",
"type": "address"
}
],
"name": "facetFunctionSelectors",
"outputs": [
{
"internalType": "bytes4[]",
"name": "facetFunctionSelectors_",
"type": "bytes4[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "facets",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"internalType": "struct IDiamondLoupe.Facet[]",
"name": "facets_",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,351 @@
[
{
"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": "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": "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": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "poolOfOwnerByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"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": "amounts",
"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": "amount",
"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": [],
"name": "totalPools",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "totalPoolsByOwner",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,21 @@
[
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,47 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "owner_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,63 @@
[
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "facetAddress",
"type": "address"
},
{
"internalType": "enum IDiamondCut.FacetCutAction",
"name": "action",
"type": "uint8"
},
{
"internalType": "bytes4[]",
"name": "functionSelectors",
"type": "bytes4[]"
}
],
"indexed": false,
"internalType": "struct IDiamondCut.FacetCut[]",
"name": "_diamondCut",
"type": "tuple[]"
},
{
"indexed": false,
"internalType": "address",
"name": "_init",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "DiamondCut",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
}
]

Wyświetl plik

@ -0,0 +1,21 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousController",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "ControlTransferred",
"type": "event"
}
]

Wyświetl plik

@ -0,0 +1,46 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousController",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "ControlTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "previousController",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "PoolControlTransferred",
"type": "event"
}
]

Wyświetl plik

@ -0,0 +1,46 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousController",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "ControlTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "previousController",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "PoolControlTransferred",
"type": "event"
}
]

Wyświetl plik

@ -0,0 +1,203 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_MOONSTREAM_TOKEN_ADDRESS",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "_FAUCET_AMOUNT",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_FAUCET_BLOCK_INTERVAL",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getFaucetAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getFaucetBlockInterval",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "getLastClaimedBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMoonstreamTokenAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "getMoonstreamTokenBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_FAUCET_AMOUNT",
"type": "uint256"
}
],
"name": "setFaucetAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_FAUCET_BLOCK_INTERVAL",
"type": "uint256"
}
],
"name": "setFaucetBlockInterval",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_MOONSTREAM_TOKEN_ADDRESS",
"type": "address"
}
],
"name": "setMoonstreamTokenAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,47 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "owner_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,9 @@
[
{
"inputs": [],
"name": "init",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -816,4 +816,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]

Wyświetl plik

@ -0,0 +1,789 @@
[
{
"inputs": [],
"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": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": false,
"internalType": "address[]",
"name": "toAddresses",
"type": "address[]"
},
{
"indexed": false,
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"name": "PoolMintBatch",
"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": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "approveForPool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"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": "from",
"type": "address"
},
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "contractURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_capacity",
"type": "uint256"
},
{
"internalType": "bool",
"name": "_transferable",
"type": "bool"
},
{
"internalType": "bool",
"name": "_burnable",
"type": "bool"
}
],
"name": "createPoolV1",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_capacity",
"type": "uint256"
}
],
"name": "createSimplePool",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"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": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForPool",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isFixture",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "poolIDs",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "mintBatch",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paymentToken",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "poolBasePrice",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "toAddresses",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
}
],
"name": "poolMintBatch",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "ids",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"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": "amount",
"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": "string",
"name": "_contractURI",
"type": "string"
}
],
"name": "setContractURI",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "setController",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newPaymentToken",
"type": "address"
}
],
"name": "setPaymentToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newBasePrice",
"type": "uint256"
}
],
"name": "setPoolBasePrice",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "address",
"name": "newController",
"type": "address"
}
],
"name": "setPoolController",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
},
{
"internalType": "string",
"name": "poolURI",
"type": "string"
}
],
"name": "setURI",
"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": [],
"name": "terminusController",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
}
],
"name": "terminusPoolCapacity",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
}
],
"name": "terminusPoolController",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
}
],
"name": "terminusPoolSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalPools",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolID",
"type": "uint256"
}
],
"name": "uri",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "toAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdrawPayments",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,9 @@
[
{
"inputs": [],
"name": "init",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,9 @@
[
{
"inputs": [],
"name": "init",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,15 @@
[
{
"inputs": [],
"name": "isFixture",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
}
]

Wyświetl plik

@ -0,0 +1,71 @@
import React, { useContext } from "react";
import {
Flex,
Badge,
Spinner,
Button,
Td,
Tr,
Table,
Thead,
} from "@chakra-ui/react";
import { TERMINUS_DIAMOND_ADDRESS } from "../src/AppDefintions";
import { targetChain } from "../src/core/providers/Web3Provider";
import { useRouter } from "../src/core/hooks";
import useTerminusPool from "../src/core/hooks/useTerminusPool";
import Web3Context from "../src/core/providers/Web3Provider/context";
import useTerminus from "../src/core/hooks/useTerminus";
import PoolCard from "../src/components/PoolCard";
const TerminusPoolControlPage = () => {
const router = useRouter();
const { poolId } = router.params;
const terminusPool = useTerminusPool({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
targetChain,
poolId: poolId,
});
const web3provider = useContext(Web3Context);
const handleClick = () => {
terminusPool.mintPoolNFTMutation.mutate({
address: `0xb4231b174a09d3510d75197C6de391ad97702116`,
amount: 1,
poolId: poolId,
});
};
if (terminusPool.terminusFacetCache.isLoading) return <Spinner />;
return (
<Flex
w="100%"
px={2}
// maxW="1337px"
minH="100vh"
direction="column"
placeSelf={"center"}
>
{web3provider.account ===
terminusPool.terminusFacetCache.data?.controller && (
<PoolCard poolId={poolId} hideOpen />
)}
<Table>
<Thead>
<Tr>
<Td>Id</Td>
<Td>Address</Td>
<Td>Notes</Td>
<Td>Actions</Td>
</Tr>
</Thead>
</Table>
</Flex>
);
};
// TerminusPoolControlPage.getLayout = getLayout
export default TerminusPoolControlPage;

Wyświetl plik

@ -1,65 +1,45 @@
import React, { useContext } from "react";
import {
Stack,
Heading,
Center,
Flex,
Badge,
Image,
Text,
Spacer,
Spinner,
Button,
} from "@chakra-ui/react";
import { Flex, Button, Image, Center } from "@chakra-ui/react";
import { DEFAULT_METATAGS } from "../src/core/constants";
import { TERMINUS_DIAMOND_ADDRESS } from "../src/AppDefintions";
import { targetChain } from "../src/core/providers/Web3Provider";
import UIContext from "../src/core/providers/UIProvider/context";
import useTerminus from "../src/core/hooks/useTerminus";
import useTerminusPool from "../src/core/hooks/useTerminusPool";
import PoolCard from "../src/components/PoolCard";
const assets = {
import Web3Context from "../src/core/providers/Web3Provider/context";
import Terminus from "../src/components/Terminus";
const assets: any = {
onboarding:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/unim-onboarding.png",
};
const Homepage = () => {
const ui = useContext(UIContext);
const terminus = useTerminus({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
targetChain: targetChain,
});
const web3Provider = useContext(Web3Context);
// const terminusPool1 = useTerminusPool({
// DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
// targetChain,
// poolId: "74",
// });
if (!terminus.terminusFacetCache.data?.totalPools) return "";
return (
<>
<Center w="100%" bgColor="blue.1200">
<Button
variant={"solid"}
colorScheme={"yellow"}
onClick={() => terminus.createPoolMutation.mutate("100")}
isLoading={terminus.createPoolMutation.isLoading}
>
New Pool
</Button>
</Center>
{terminus.terminusFacetCache.data?.ownedPoolIds.map((ownedPoolId) => (
<PoolCard
key={`ownedpool-${ownedPoolId}`}
poolId={String(ownedPoolId)}
/>
))}
<Stack />
</>
<Flex w="100%" minH="100vh" bgColor={"blue.1200"} direction={"column"}>
{web3Provider.account && <Terminus />}
{!web3Provider.account &&
web3Provider.buttonText !== web3Provider.WALLET_STATES.CONNECTED && (
<Center>
<Button
mt={20}
colorScheme={
web3Provider.buttonText === web3Provider.WALLET_STATES.CONNECTED
? "orange"
: "orange"
}
onClick={web3Provider.onConnectWalletClick}
>
{web3Provider.buttonText}
{" "}
<Image
pl={2}
h="24px"
src="https://raw.githubusercontent.com/MetaMask/brand-resources/master/SVG/metamask-fox.svg"
/>
</Button>
</Center>
)}
</Flex>
);
};

Wyświetl plik

@ -10,7 +10,7 @@ const Fonts = () => (
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('./Virgil.woff2') format('woff2'), url('./Virgil.woff') format('woff');
src: url('/Virgil.woff2') format('woff2'), url('/Virgil.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@ -19,7 +19,7 @@ const Fonts = () => (
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('./Virgil.woff2') format('woff2'), url('./Virgil.woff') format('woff');
src: url('/Virgil.woff2') format('woff2'), url('/Virgil.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
`}

Wyświetl plik

@ -15,7 +15,7 @@ import { createBreakpoints } from "@chakra-ui/theme-tools";
const breakpointsCustom = createBreakpoints({
sm: "24em", //Mobile phone
md: "64em", //Tablet or rotated phone
md: "64.01em", //Tablet or rotated phone
lg: "89.9em", //QHD
xl: "160em", //4k monitor
"2xl": "192em", // Mac Book 16" and above
@ -27,6 +27,10 @@ const Accordion = {
container: { borderColor: "white.300" },
panel: { pb: 4 },
},
// defaultProps: {
// size: "xl",
// item: { borderColor: "white.300" },
// },
};
const theme = extendTheme({
@ -37,7 +41,7 @@ const theme = extendTheme({
styles: {
global: {
body: {
color: "gray.300",
color: "blue.1200",
},
},
},
@ -58,9 +62,9 @@ const theme = extendTheme({
},
fonts: {
heading: '"Virgil", sans-serif',
body: '"Body Virgil", sans-serif',
mono: '"Virgil", monospace',
heading: '"Work Sans", sans-serif',
body: '"Work Sans", sans-serif',
mono: '"Work Sans", monospace',
},
fontSizes: {
xs: "0.625rem", //10px
@ -77,65 +81,52 @@ const theme = extendTheme({
},
colors: {
blue: {
0: "#FFFFFFFF",
50: "#e7f1ff",
100: "#cfe2ff",
200: "#b6d4fe",
300: "#9ec5fe",
400: "#86b7fe",
500: "#6ea8fe",
600: "#569afe",
700: "#3d8bfd",
800: "#257dfd",
900: "#0d6efd",
1000: "#0d6efd",
1100: "#0c63e4",
1200: "#0c63e4",
1300: "#0a58ca",
1400: "#094db1",
1500: "#084298",
1600: "#07377f",
1700: "#052c65",
1800: "#04214c",
1900: "#010b19",
2000: "#000000",
brand: {
100: "#212C8A",
200: "#111442",
300: "#53B9D1",
400: "#4579D8",
500: "##F29C38",
},
purple: {
blue: {
0: "#FFFFFFFF",
50: "##f1ecf9",
100: "##e2d9f3",
200: "##d4c6ec",
300: "##c5b3e6",
400: "##b7a1e0",
500: "##a98eda",
600: "#9a7bd4",
700: "##8c68cd",
800: "#7d55c7",
900: "#6f42c1",
1000: "#6f42c1",
1100: "#643bae",
1200: "#59359a",
1300: "#4e2e87",
1400: "#382161",
1500: "#21143a",
1600: "#160d27",
50: "#e9eaf4",
100: "#d3d4e9",
200: "#bcbfde",
300: "#a6a9d3",
400: "#9094c8",
500: "#7a7fbc",
600: "#6469b1",
700: "#4d54a6",
800: "#373e9b",
900: "#212990",
1000: "#1e2582",
1100: "#1a2173",
1200: "#171d65",
1300: "#141956",
1400: "#111548",
1500: "#0d103a",
1600: "#0a0c2b",
1700: "#07081d",
1800: "#03040e",
1900: "#0d103a",
2000: "#000000",
},
gray: {
0: "#FFFFFFFF",
50: "#f7f8fa",
100: "#f8f9fa",
200: "#e9ecef",
300: "#dee2e6",
400: "#ced4da",
500: "#adb5bd",
600: "#495057",
700: "#343a40",
800: "#343a40",
900: "#212529",
1000: "#9ca7b6",
100: "#eff1f4",
200: "#e6eaef",
300: "#dee3ea",
400: "#d6dce5",
500: "#ced5df",
600: "#c6ceda",
700: "#bdc7d5",
800: "#b5c0cf",
900: "#adb9ca",
1000: "##9ca7b6",
1100: "#8a94a2",
1200: "#79828d",
1300: "#686f79",
@ -150,64 +141,44 @@ const theme = extendTheme({
},
red: {
0: "#FFFFFFFF",
50: "#fcebec",
100: "#f8d7da",
200: "#f5c2c7",
300: "#f1aeb5",
400: "#ee9aa2",
500: "#ea868f",
600: "#e7727d",
700: "#e35d6a",
800: "#e04958",
900: "#dc3545",
50: "#f9eaea",
100: "#f3d6d6",
200: "#eec1c1",
300: "#e8acac",
400: "#e29898",
500: "#dc8383",
600: "#d66e6e",
700: "#d15959",
800: "#cb4545",
900: "#C53030",
},
yellow: {
0: "#FFFFFFFF",
50: "#fff9e6",
100: "#fff3cd",
200: "#ffecb5",
300: "#ffe69c",
400: "#ffe083",
500: "#ffda6a",
600: "#ffd451",
700: "#ffcd39",
800: "#ffc720",
900: "#ffc107",
},
orange: {
0: "#FFFFFFFF",
50: "#fff2e8",
100: "#ffe5d0",
200: "#fed8b9",
300: "#fecba1",
400: "#febf8a",
500: "#feb272",
600: "#fea55b",
700: "#fd9843",
800: "#fd8b2c",
900: "#fd7e14",
50: "#ffeee6",
100: "#ffddcc",
200: "#feccb3",
300: "#febb9a",
400: "#feab81",
500: "#fe9a67",
600: "#fe894e",
700: "#fd7835",
800: "#fd671b",
900: "#FD5602",
},
green: {
0: "#FFFFFFFF",
50: "#e8f3ee",
100: "#d1e7dd",
200: "#badbcc",
300: "#a3cfbb",
400: "#8cc3aa",
500: "#75b798",
600: "#5eab87",
700: "#479f76",
800: "#309365",
900: "#198754",
1000: "#198754",
1100: "#177a4c",
1200: "#146c43",
1300: "#125f3b",
1400: "#0f5132",
1500: "#0d442a",
1600: "#0a3622",
50: "#e9f6dc",
100: "#e9f6dc", //Duplicates 50!!!!
200: "#def1cb",
300: "#d3ecb9",
400: "#c9e8a8",
500: "#bee396",
600: "#b3de85",
700: "#a8d973",
800: "#9dd562",
900: "#92D050",
},
black: {
@ -217,4 +188,4 @@ const theme = extendTheme({
},
});
export default theme;
export default theme;

Wyświetl plik

@ -92,9 +92,6 @@ const Footer = () => (
/>
</Link>
</Box>
<Text textColor={"gray.300"} fontWeight={"600"}>
This is the way. Milky way.
</Text>
</Stack>
<Stack direction={"row"} spacing={6}>
{SOCIAL_LINKS.map((social_link, idx) => {

Wyświetl plik

@ -26,12 +26,8 @@ import {
import router from "next/router";
import { MODAL_TYPES } from "../core/providers/OverlayProvider/constants";
import Web3Context from "../core/providers/Web3Provider/context";
import {
UNIM_ADDRESS,
BOTTLER_ADDRESS,
TERMINUS_DIAMOND_ADDRESS,
} from "../AppDefintions";
import { chains, targetChain } from "../core/providers/Web3Provider";
import { TERMINUS_DIAMOND_ADDRESS } from "../AppDefintions";
import { targetChain } from "../core/providers/Web3Provider";
import useTerminus from "../core/hooks/useTerminus";
const LandingNavbar = () => {
@ -116,18 +112,50 @@ const LandingNavbar = () => {
h="22px"
src="https://darkforest.cryptounicorns.fun/static/media/icon_milk.6fc3d44e.png"
/>
<Text mx={2} display={"inline-block"}>
{terminus.terminusPaymentTokenCache?.data?.balance ? (
web3Provider.web3.utils.fromWei(
{terminus.terminusPaymentTokenCache?.data?.balance ? (
<Text mx={2} display={"inline-block"}>
Your balance:{" "}
{web3Provider.web3.utils.fromWei(
terminus.terminusPaymentTokenCache.data.balance,
"ether"
)
)}
</Text>
) : (
<Spinner m={0} size="xs" />
)}
</Flex>
</Badge>
{web3Provider.account ===
terminus.terminusFacetCache.data?.controller && (
<Badge
colorScheme={"pink"}
variant={"solid"}
fontSize={"md"}
borderRadius={"md"}
mr={2}
>
<Flex>
<Image
ml={2}
h="22px"
src="https://darkforest.cryptounicorns.fun/static/media/icon_milk.6fc3d44e.png"
/>
{terminus.terminusPaymentTokenCache?.data
?.spenderBalance ? (
<Text mx={2} display={"inline-block"}>
Terminus contract balance:{" "}
{web3Provider.web3.utils.fromWei(
terminus.terminusPaymentTokenCache.data
.spenderBalance,
"ether"
)}
</Text>
) : (
<Spinner m={0} size="xs" />
)}
</Text>
</Flex>
</Badge>
</Flex>
</Badge>
)}
<Badge
colorScheme={"green"}
variant={"solid"}

Wyświetl plik

@ -17,7 +17,7 @@ const Navbar = () => {
id="Navbar"
minH="3rem"
maxH="3rem"
bgColor="yellow.500"
bgColor="blue.900"
direction="row"
w="100%"
overflow="hidden"

Wyświetl plik

@ -1,4 +1,4 @@
import React, { useContext } from "react";
import React, { FC, useContext } from "react";
import {
Stack,
Heading,
@ -10,40 +10,274 @@ import {
Spacer,
Spinner,
Button,
chakra,
Fade,
Input,
NumberInput,
NumberInputField,
NumberInputStepper,
NumberIncrementStepper,
NumberDecrementStepper,
} from "@chakra-ui/react";
import { TERMINUS_DIAMOND_ADDRESS } from "../AppDefintions";
import { targetChain } from "../core/providers/Web3Provider";
import UIContext from "../core/providers/UIProvider/context";
import Web3Provider, { targetChain } from "../core/providers/Web3Provider";
import { FlexProps } from "@chakra-ui/react";
import RouteButton from "../components/RouteButton";
import useTerminus from "../core/hooks/useTerminus";
import useTerminusPool from "../core/hooks/useTerminusPool";
import Web3Context from "../core/providers/Web3Provider/context";
const PoolCard = ({ poolId }: { poolId: string }) => {
const ui = useContext(UIContext);
// intersecting
interface PoolCardProps extends FlexProps {
poolId: string;
hideOpen: boolean;
}
const STATES = {
default: 0,
URIArgs: 1,
mintArgs: 2,
poolControllerArgs: 3,
};
const PoolCard: FC<PoolCardProps> = ({ poolId, hideOpen, ...props }) => {
const web3Provider = useContext(Web3Context);
const [state, setState] = React.useState(STATES.default);
const [argument, setArgument] = React.useState<any>("");
const terminus = useTerminus({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
targetChain: targetChain,
});
const handleArgumentChange = (event: any) => setArgument(event.target.value);
const handleArgumentAddressChange = (event: any) =>
setArgument((current: any) => {
return { ...current, address: event.target.value };
});
const handleArgumentAmountChange = (value: any) =>
setArgument((current: any) => {
return { ...current, amount: value };
});
const terminusPool = useTerminusPool({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
poolId,
targetChain,
poolId: poolId,
});
if (terminusPool.terminusFacetCache.isLoading) return <Spinner />;
return (
<Center>
<Flex
w="100%"
h="3rem"
bgColor="purple.900"
borderRadius={"lg"}
mt={2}
maxW="1337px"
placeContent={"center"}
>
<Text>{terminusPool.terminusFacetCache.data?.capacity}</Text>
<Text>{terminusPool.terminusFacetCache.data?.supply}</Text>
<Text>{terminusPool.terminusFacetCache.data?.uri}</Text>
</Flex>
</Center>
<Flex {...props} px={[2, "20px", "40px"]}>
<Badge variant="subtle" colorScheme={"blue"}>
Pool ID: #{poolId}
</Badge>
<Spacer />
{state === STATES.URIArgs && (
<Fade
in={state === STATES.URIArgs ? true : false}
style={{ width: "100%" }}
>
<Flex w="100%" justifyContent="center" px={20} alignItems="baseline">
<Input
value={argument}
onChange={handleArgumentChange}
placeholder="New terminus pool uri"
size="md"
fontSize={"sm"}
w="100%"
variant={"outline"}
minW="420px"
/>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.setPoolURI
.mutateAsync({
poolId: poolId,
newURI: argument,
})
.then(() => {
setState(STATES.default);
setArgument("");
})
}
isLoading={terminus.setPoolURI.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.default)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.poolControllerArgs && (
<Fade
in={state === STATES.poolControllerArgs ? true : false}
style={{ width: "100%" }}
>
<Flex w="100%" justifyContent="center" px={20} alignItems="baseline">
<Input
value={argument}
onChange={handleArgumentChange}
placeholder="New terminus pool controller address"
size="md"
fontSize={"sm"}
w="100%"
variant={"outline"}
minW="420px"
/>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminusPool.setPoolController
.mutateAsync({
newController:
web3Provider.web3.utils.toChecksumAddress(argument),
})
.then(() => {
setState(STATES.default);
setArgument("");
})
}
isLoading={terminusPool.setPoolController.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.default)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.default && (
<>
<Badge
colorScheme={"orange"}
variant="outline"
fontSize={"16px"}
size="md"
>
Issued tokens: {terminusPool.terminusFacetCache.data?.supply} /{" "}
{terminusPool.terminusFacetCache.data?.capacity}
</Badge>
<Spacer />
<Button
colorScheme={"blue"}
variant="solid"
size="sm"
onClick={() => setState(STATES.URIArgs)}
>
Set URI
</Button>
<Button
colorScheme={"blue"}
variant="solid"
size="sm"
onClick={() => setState(STATES.mintArgs)}
>
Mint new
</Button>
<Button
colorScheme={"blue"}
variant="solid"
size="sm"
onClick={() => setState(STATES.poolControllerArgs)}
>
Transfer controller
</Button>
{!hideOpen && (
<RouteButton
variant="outline"
colorScheme="green"
size="sm"
href={`/${poolId}`}
>
Open
</RouteButton>
)}
</>
)}
{state === STATES.mintArgs && (
<Fade
in={state === STATES.mintArgs ? true : false}
style={{ width: "100%" }}
>
<Flex w="100%" alignItems="center" px={20}>
<Input
value={argument.address}
onChange={handleArgumentAddressChange}
placeholder="Addres to mint for"
size="md"
fontSize={"sm"}
w="100%"
variant={"outline"}
minW="420px"
/>
<NumberInput
defaultValue={0}
onChange={handleArgumentAmountChange}
value={argument.amount}
size="md"
mx={2}
isDisabled={terminus.withrawPayments.isLoading}
>
<NumberInputField />
<NumberInputStepper>
<NumberIncrementStepper />
<NumberDecrementStepper />
</NumberInputStepper>
</NumberInput>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminusPool.mintPoolNFTMutation
.mutateAsync({
poolId: poolId,
address: web3Provider.web3.utils.toChecksumAddress(
argument.address
),
amount: argument.amount,
})
.then(() => {
setState(STATES.default);
setArgument("");
})
}
isLoading={terminusPool.mintPoolNFTMutation.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.default)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
</Flex>
);
};
export default PoolCard;
export default chakra(PoolCard, {
baseStyle: {
w: "100%",
h: "auto",
bgColor: "purple.900",
borderRadius: "lg",
my: 2,
maxW: "1337px",
placeContent: "center",
py: 2,
},
});

Wyświetl plik

@ -0,0 +1,66 @@
import React, { useContext } from "react";
import { Flex, Spinner } from "@chakra-ui/react";
import { TERMINUS_DIAMOND_ADDRESS } from "../AppDefintions";
import { targetChain } from "../core/providers/Web3Provider";
import useTerminus from "../core/hooks/useTerminus";
import PoolCard from "./PoolCard";
import TerminusControllerPanel from "./TerminusControllerPanel";
import Web3Context from "../core/providers/Web3Provider/context";
import TerminusOwnerPanel from "./TerminusOwnerPanel";
const Terminus = () => {
const terminus = useTerminus({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
targetChain: targetChain,
});
const web3Provider = useContext(Web3Context);
if (!terminus.terminusFacetCache.data?.totalPools) return <Spinner />;
console.log(
"terminus.terminusFacetCache.data.ownedPoolIds",
terminus.terminusFacetCache.data.ownedPoolIds
);
return (
<Flex
w="100%"
minH="100vh"
direction={"column"}
maxW="1337px"
alignSelf={"center"}
>
{terminus.terminusFacetCache.data.controller === web3Provider.account && (
<TerminusControllerPanel
borderRadius={"md"}
my={2}
bgColor="blue.600"
py={4}
/>
)}
{terminus.terminusFacetCache.data.owner === web3Provider.account && (
<TerminusOwnerPanel
borderRadius={"md"}
my={2}
bgColor="blue.600"
py={4}
/>
)}
<Flex w="100%" direction="column">
{terminus.terminusFacetCache.data.ownedPoolIds.map((i) => (
<PoolCard
alignItems={"baseline"}
// mx={["20px", "7%", null, "7%"]}
maxW="1337px"
key={`pool-${i}`}
poolId={String(i)}
bgColor="blue.500"
/>
))}
</Flex>
</Flex>
);
};
export default Terminus;

Wyświetl plik

@ -0,0 +1,438 @@
import React, { FC, useContext } from "react";
import {
Flex,
Button,
chakra,
Stack,
Input,
Fade,
NumberInput,
NumberInputField,
NumberInputStepper,
NumberIncrementStepper,
NumberDecrementStepper,
Slider,
SliderTrack,
SliderFilledTrack,
SliderThumb,
} from "@chakra-ui/react";
import { TERMINUS_DIAMOND_ADDRESS } from "../AppDefintions";
import { targetChain } from "../core/providers/Web3Provider";
import { FlexProps } from "@chakra-ui/react";
import useTerminus from "../core/hooks/useTerminus";
import Web3Context from "../core/providers/Web3Provider/context";
const STATES = {
buttons: 0,
transferOwnershipArgs: 1,
withrawFundsArgs: 2,
setControllerArgs: 3,
setPoolBasePriceArgs: 4,
URIArgs: 5,
setPaymentTokenArgs: 6,
newPoolArgs: 7,
};
const TerminusControllerPanel: FC<FlexProps> = (props) => {
const terminus = useTerminus({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
targetChain: targetChain,
});
const [state, setState] = React.useState(STATES.buttons);
const [address, setAddressField] = React.useState("");
const [newURI, setNewURI] = React.useState("");
const [amount, setAmountField] = React.useState(0);
const handleAddressFieldChange = (event: any) =>
setAddressField(event.target.value);
const handleAmountFieldChange = (event: any) => setAmountField(event);
const handleURIFieldChange = (event: any) => setNewURI(event.target.value);
const web3Provider = useContext(Web3Context);
return (
<Flex {...props}>
<Stack direction={"column"} w="100%">
<Flex justifyContent={"center"} fontWeight="600" textColor={"blue.50"}>
Pool controller panel
</Flex>
{state === STATES.buttons && (
<Fade in={state === STATES.buttons ? true : false}>
<Flex w="100%" justifyContent="space-evenly">
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.newPoolArgs)}
>
New Pool
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.setControllerArgs)}
>
Transfer control
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.withrawFundsArgs)}
isDisabled={
Number(
terminus.terminusPaymentTokenCache.data?.spenderBalance
) === 0
}
>
Withraw payments
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.setPoolBasePriceArgs)}
>
Set pool price
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.URIArgs)}
>
Set contract URI
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.setPaymentTokenArgs)}
>
Set payment token
</Button>
</Flex>
</Fade>
)}
{state === STATES.setControllerArgs && (
<Fade in={state === STATES.setControllerArgs ? true : false}>
<Flex
w="100%"
justifyContent="center"
px={20}
alignItems="baseline"
>
<Input
value={address}
onChange={handleAddressFieldChange}
placeholder="New terminus controller address"
size="md"
maxW="420px"
fontSize={"sm"}
isDisabled={terminus.setTerminusController.isLoading}
/>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.setTerminusController.mutate({
newController: address,
})
}
isLoading={terminus.setTerminusController.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.buttons)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.setPaymentTokenArgs && (
<Fade in={state === STATES.setPaymentTokenArgs ? true : false}>
<Flex
w="100%"
justifyContent="center"
px={20}
alignItems="baseline"
>
<Input
value={address}
onChange={handleAddressFieldChange}
placeholder="New terminus controller address"
size="md"
maxW="420px"
fontSize={"sm"}
isDisabled={terminus.setPaymentToken.isLoading}
/>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.setPaymentToken
.mutateAsync({
paymentTokenAddress: address,
})
.then(() => {
setAddressField("");
setState(STATES.buttons);
})
}
isLoading={terminus.setTerminusController.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.buttons)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.withrawFundsArgs && (
<Fade in={state === STATES.withrawFundsArgs ? true : false}>
<Flex w="100%" justifyContent="center" px={20} alignItems="center">
<Flex bgColor={"gray.300"} borderRadius="md" p={1}>
<NumberInput
defaultValue={0}
precision={1}
step={1}
onChange={handleAmountFieldChange}
value={amount}
size="md"
mx={2}
isDisabled={terminus.withrawPayments.isLoading}
>
<NumberInputField />
<NumberInputStepper>
<NumberIncrementStepper />
<NumberDecrementStepper />
</NumberInputStepper>
</NumberInput>
<Slider
isDisabled={
terminus.withrawPayments.isLoading &&
Number(
terminus.terminusPaymentTokenCache.data?.spenderBalance
) > 0
}
minW="300px"
mx={3}
flex="1"
focusThumbOnChange={false}
value={amount}
onChange={handleAmountFieldChange}
min={0}
max={
terminus.terminusPaymentTokenCache.data?.spenderBalance
? Number(
web3Provider.web3.utils.fromWei(
terminus.terminusPaymentTokenCache.data
.spenderBalance,
"ether"
)
) ?? 0
: 0
}
>
<SliderTrack>
<SliderFilledTrack />
</SliderTrack>
<SliderThumb fontSize="sm" boxSize="16px" />
</Slider>
</Flex>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.withrawPayments
.mutateAsync({
toAddress: web3Provider.account,
amount: web3Provider.web3.utils.toWei(
String(amount),
"ether"
),
})
.then(() => {
setState(STATES.buttons);
setAmountField(0);
})
}
isLoading={terminus.withrawPayments.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.buttons)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.setPoolBasePriceArgs && (
<Fade in={state === STATES.setPoolBasePriceArgs ? true : false}>
<Flex w="100%" justifyContent="center" px={20} alignItems="center">
<Flex
bgColor={"gray.300"}
borderRadius="md"
p={1}
alignItems="center"
>
New pool base price:
<NumberInput
defaultValue={0}
precision={1}
step={1}
onChange={handleAmountFieldChange}
value={amount}
size="md"
mx={2}
isDisabled={terminus.withrawPayments.isLoading}
>
<NumberInputField />
<NumberInputStepper>
<NumberIncrementStepper />
<NumberDecrementStepper />
</NumberInputStepper>
</NumberInput>
</Flex>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.setPoolBasePrice
.mutateAsync({
newPoolBasePrice: web3Provider.web3.utils.toWei(
String(amount),
"ether"
),
})
.then(() => {
setState(STATES.buttons);
setAmountField(0);
})
}
isLoading={terminus.withrawPayments.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.buttons)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.newPoolArgs && (
<Fade in={state === STATES.newPoolArgs ? true : false}>
<Flex w="100%" justifyContent="center" px={20} alignItems="center">
<Flex
bgColor={"gray.300"}
borderRadius="md"
p={1}
alignItems="center"
>
New pool maximum supply:
<NumberInput
onChange={handleAmountFieldChange}
value={amount}
size="md"
mx={2}
isDisabled={terminus.createPoolMutation.isLoading}
>
<NumberInputField />
<NumberInputStepper>
<NumberIncrementStepper />
<NumberDecrementStepper />
</NumberInputStepper>
</NumberInput>
</Flex>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.createPoolMutation
.mutateAsync(String(amount))
.then(() => {
setState(STATES.buttons);
setAmountField(0);
})
}
isLoading={terminus.createPoolMutation.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => {
setState(STATES.buttons);
setAmountField(0);
}}
>
Cancel
</Button>
</Flex>
</Fade>
)}
{state === STATES.URIArgs && (
<Fade in={state === STATES.URIArgs ? true : false}>
<Flex w="100%" justifyContent="center" px={20} alignItems="center">
<Flex
bgColor={"gray.300"}
borderRadius="md"
p={1}
alignItems="center"
>
<Input
value={newURI}
onChange={handleURIFieldChange}
placeholder="New terminus uri"
size="md"
minW="420px"
maxW="820px"
fontSize={"sm"}
isDisabled={terminus.setTerminusController.isLoading}
/>
</Flex>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.setURI.mutateAsync({ newURI: newURI }).then(() => {
setState(STATES.buttons);
setNewURI("");
})
}
isLoading={terminus.withrawPayments.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.buttons)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
</Stack>
</Flex>
);
};
export default chakra(TerminusControllerPanel, {
baseStyle: {
w: "100%",
direction: "row",
bgColor: "orange.100",
},
});

Wyświetl plik

@ -0,0 +1,91 @@
import React, { FC } from "react";
import { Flex, Button, chakra, Stack, Input, Fade } from "@chakra-ui/react";
import { TERMINUS_DIAMOND_ADDRESS } from "../AppDefintions";
import { targetChain } from "../core/providers/Web3Provider";
import { FlexProps } from "@chakra-ui/react";
import useTerminus from "../core/hooks/useTerminus";
const STATES = {
buttons: 0,
transferOwnershipArgs: 1,
};
const TerminusOwnerPanel: FC<FlexProps> = (props) => {
const terminus = useTerminus({
DiamondAddress: TERMINUS_DIAMOND_ADDRESS,
targetChain: targetChain,
});
const [state, setState] = React.useState(STATES.buttons);
const [newOwner, setNewOwnerField] = React.useState("");
const handleNewOwnerFieldChange = (event: any) =>
setNewOwnerField(event.target.value);
return (
<Flex {...props}>
<Stack direction={"column"} w="100%">
<Flex justifyContent={"center"} fontWeight="600" textColor={"blue.50"}>
Pool owner panel
</Flex>
{state === STATES.buttons && (
<Fade in={state === STATES.buttons ? true : false}>
<Flex w="100%" justifyContent="space-evenly">
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.transferOwnershipArgs)}
>
Transfer ownership
</Button>
</Flex>
</Fade>
)}
{state === STATES.transferOwnershipArgs && (
<Fade in={state === STATES.transferOwnershipArgs ? true : false}>
<Flex
w="100%"
justifyContent="center"
px={20}
alignItems="baseline"
>
<Input
value={newOwner}
onChange={handleNewOwnerFieldChange}
placeholder="New terminus owner address"
size="md"
maxW="420px"
fontSize={"sm"}
/>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() =>
terminus.transferTerminusOwnershipMutation.mutate({
newOwner: newOwner,
})
}
isLoading={terminus.transferTerminusOwnershipMutation.isLoading}
>
Submit
</Button>
<Button
variant={"solid"}
colorScheme={"orange"}
onClick={() => setState(STATES.buttons)}
>
Cancel
</Button>
</Flex>
</Fade>
)}
</Stack>
</Flex>
);
};
export default chakra(TerminusOwnerPanel, {
baseStyle: {
w: "100%",
direction: "row",
bgColor: "red.100",
boxShadow: "revert",
},
});

Wyświetl plik

@ -10,12 +10,12 @@ export const APP_API_URL = process.env.NEXT_PUBLIC_APP_API_URL;
image: URL of image to display on page preview in search engines and link shares
*/
export const DEFAULT_METATAGS = {
title: "UNIM bottler",
description: "Sell your UNIM on OpenSea",
keywords: "web3, smart contracts, unim, nfts",
title: "Moonstream terminus",
description: "web3 whitelists made easy",
keywords: "web3, smart contracts, terminus, nfts",
//TODO(@Peersky): setup correct url here
url: "https://bottler.cryptounicorns.exchange",
image: `https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/small_um.png`,
url: "",
image: ``,
};
/*
@ -84,12 +84,12 @@ export const AWS_ASSETS_PATH = `assets/path`;
/*
White Logo with text URL (.png)
*/
export const WHITE_LOGO_W_TEXT_URL = `https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/bottler-logo.png`;
export const WHITE_LOGO_W_TEXT_URL = `https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/moon-logo%2Btext-white.png`;
/*
White Logo URL (.svg)
*/
export const WHITE_LOGO_SVG = `https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/small_um.png`;
export const WHITE_LOGO_SVG = `https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/moon-logo%2Btext-white.png`;
export const TIME_RANGE_SECONDS = {
day: 86400,

Wyświetl plik

@ -5,14 +5,14 @@ import { BaseContract } from "../../../contracts/types";
import Web3 from "web3";
import { Web3ProviderInterface } from "../providers/Web3Provider/context";
// import erc20abi from "../../../abi/erc20.json";
const erc20abi = require("../../../abi/erc20.json");
const erc20abi = require("../../../abi/ERC20Facet.json");
export const setAllowance =
(
provider: Web3ProviderInterface,
address: string,
defaultTxConfig: any,
defaultSpender?: string,
defaultSpender?: string
) =>
async ({
amount,
@ -56,6 +56,9 @@ export const getTokenState =
const balance = account
? await erc20contract.methods.balanceOf(account).call()
: null;
const spenderBalance = spender
? await erc20contract.methods.balanceOf(spender).call()
: null;
const allowance =
spender && account
? await erc20contract.methods.allowance(account, spender).call()
@ -64,5 +67,13 @@ export const getTokenState =
const symbol = await erc20contract.methods.symbol().call();
const decimals = await erc20contract.methods.decimals().call();
const name = await erc20contract.methods.name().call();
return { totalSupply, symbol, decimals, name, balance, allowance };
return {
totalSupply,
symbol,
decimals,
name,
balance,
allowance,
spenderBalance,
};
};

Wyświetl plik

@ -1,34 +1,33 @@
import { TerminusFacet } from "../../../contracts/TerminusFacet";
import { BaseContract } from "../../../contracts/types";
import { setAllowance } from "./ERC20.contracts";
import BN from "bn.js";
import Web3 from "web3";
import { ERC20WithCommonStorage } from "../../../contracts/ERC20WithCommonStorage";
import { MoonstreamTokenFaucet } from "../../../contracts/MoonstreamTokenFaucet";
const erc20abi = require("../../../abi/erc20.json");
import { OwnershipFacet } from "../../../contracts/OwnershipFacet";
export const getTerminusFacetState =
(contract: BaseContract, owner?: string) => async () => {
console.log("getTerminusFacetState");
const terminusFacet = contract as TerminusFacet;
// const controller = await terminusFacet.methods.terminusController().call();
(
contracts: { ownershipFacet: BaseContract; terminusFacet: BaseContract },
account?: string
) =>
async () => {
const terminusFacet = contracts.terminusFacet as TerminusFacet;
const ownershipFacet = contracts.ownershipFacet as OwnershipFacet;
const poolBasePrice = await terminusFacet.methods.poolBasePrice().call();
console.log("poolBasePrice", poolBasePrice);
const paymentToken = await terminusFacet.methods.paymentToken().call();
const contractURI = await terminusFacet.methods.contractURI().call();
const totalPools = await terminusFacet.methods.totalPools().call();
const owner = await ownershipFacet.methods.owner().call();
const controller = await terminusFacet.methods.terminusController().call();
let numberOfOwnedPools = "0";
let ownedPoolIds = [];
if (owner) {
if (account) {
numberOfOwnedPools = await terminusFacet.methods
.totalPoolsByOwner(owner)
.totalPoolsByOwner(account)
.call();
if (numberOfOwnedPools !== "0") {
const n = new Number(numberOfOwnedPools);
for (let i = 0; i < n; i++) {
const poolId = await terminusFacet.methods
.poolOfOwnerByIndex(owner, i)
.poolOfOwnerByIndex(account, i)
.call();
ownedPoolIds.push(poolId);
}
@ -42,6 +41,8 @@ export const getTerminusFacetState =
totalPools,
numberOfOwnedPools,
ownedPoolIds,
owner,
controller,
};
};
@ -62,13 +63,6 @@ export const getTerminusFacetPoolState =
return { controller, supply, uri, capacity };
};
export const getNumberOfPoolsByOwner =
(contract: BaseContract, owner: string) => async () => {
const terminusFacet = contract as TerminusFacet;
return number;
};
export const createSimplePool =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
@ -86,3 +80,166 @@ export const createSimplePool =
.send(txConfig);
return response;
};
export const mintNewAccessToken =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
address,
poolId,
amount,
transactionConfig,
}: {
address: string;
amount: number;
poolId: string;
transactionConfig?: any;
}) => {
console.debug("mintNewAccessToken", address, amount, poolId);
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
console.debug("address", address);
const response = await terminusFacet.methods
.mint(address, poolId, amount, "asd")
.send(txConfig);
return response;
};
export const transferTerminusOwnership =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
newOwner,
transactionConfig,
}: {
newOwner: string;
transactionConfig?: any;
}) => {
const ownershipFacet = contract as OwnershipFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await ownershipFacet.methods
.transferOwnership(newOwner)
.send(txConfig);
return response;
};
export const setController =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
newController,
transactionConfig,
}: {
newController: string;
transactionConfig?: any;
}) => {
const terminus = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminus.methods
.setController(newController)
.send(txConfig);
return response;
};
export const withrawTerminusFunds =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
toAddress,
amount,
transactionConfig,
}: {
toAddress: string;
amount: string;
transactionConfig?: any;
}) => {
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminusFacet.methods
.withdrawPayments(toAddress, amount)
.send(txConfig);
return response;
};
export const setTerminusPoolBasePrice =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
newPoolBasePrice,
transactionConfig,
}: {
newPoolBasePrice: string;
transactionConfig?: any;
}) => {
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminusFacet.methods
.setPoolBasePrice(newPoolBasePrice)
.send(txConfig);
return response;
};
export const setTerminusURI =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
newURI,
transactionConfig,
}: {
newURI: string;
transactionConfig?: any;
}) => {
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminusFacet.methods
.setContractURI(newURI)
.send(txConfig);
return response;
};
export const setTerminusPoolURI =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
newURI,
poolId,
transactionConfig,
}: {
newURI: string;
poolId: string;
transactionConfig?: any;
}) => {
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminusFacet.methods
.setURI(poolId, newURI)
.send(txConfig);
return response;
};
export const setTerminusPaymentToken =
(contract: BaseContract, defaultTxConfig: any) =>
async ({
paymentTokenAddress,
transactionConfig,
}: {
paymentTokenAddress: string;
transactionConfig?: any;
}) => {
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminusFacet.methods
.setPaymentToken(paymentTokenAddress)
.send(txConfig);
return response;
};
export const setTerminusPoolController =
(contract: BaseContract, poolId: string, defaultTxConfig: any) =>
async ({
newController,
transactionConfig,
}: {
newController: string;
transactionConfig?: any;
}) => {
const terminusFacet = contract as TerminusFacet;
const txConfig = { ...defaultTxConfig, ...transactionConfig };
const response = await terminusFacet.methods
.setPoolController(poolId, newController)
.send(txConfig);
return response;
};

Wyświetl plik

@ -1,75 +1,22 @@
import React, { useContext } from "react";
import Web3Context from "../providers/Web3Provider/context";
import { useToast } from "./";
import { web3MethodCall } from "../providers/Web3Provider/context";
import useWeb3MethodCall from "./useWeb3MethodCall";
import DataContext from "../providers/DataProvider/context";
import BN from "bn.js";
import {
useMutation,
useQuery,
useQueryClient,
UseQueryResult,
} from "react-query";
import { queryCacheProps } from "./hookCommon";
// import { }
// import { bottler } from ...
import { Diamond } from "../../../contracts/Diamond";
import { DiamondLoupeFacet } from "../../../contracts/DiamondLoupeFacet";
import { DiamondCutFacet } from "../../../contracts/DiamondCutFacet";
import { OwnershipFacet } from "../../../contracts/OwnershipFacet";
import { TerminusFacet } from "../../../contracts/TerminusFacet";
import { useMutation, useQuery, UseQueryResult } from "react-query";
import {
getTerminusFacetState,
createSimplePool,
transferTerminusOwnership,
withrawTerminusFunds,
setController,
setTerminusPoolBasePrice,
setTerminusURI,
setTerminusPoolURI,
setTerminusPaymentToken,
} from "../contracts/terminus.contracts";
import { getTokenState, setAllowance } from "../contracts/ERC20.contracts";
export interface BottleType {
name: string;
imageUrl: string;
emptyImageURL: string;
// TODO(zomglings): Rename to poolIndex. It is too easy to confuse poolId as referring to the Terminus
// pool ID.
poolId: number;
terminusPoolId: number;
}
export interface BottleTypes {
small: BottleType;
medium: BottleType;
large: BottleType;
}
export const BOTTLE_TYPES: BottleTypes = {
small: {
name: "small",
emptyImageURL:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/small_empty_bottle.png",
imageUrl:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/small_um.png",
poolId: 0,
terminusPoolId: 5,
},
medium: {
name: "medium",
emptyImageURL:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/medium_empty_bottle.png",
imageUrl:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/medium_um.png",
poolId: 1,
terminusPoolId: 6,
},
large: {
name: "large",
emptyImageURL:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/large_empty_bottle.png",
imageUrl:
"https://s3.amazonaws.com/static.simiotics.com/unicorn_bazaar/large_um.png",
poolId: 2,
terminusPoolId: 7,
},
};
export interface useBottlerReturns {
balanceCache: UseQueryResult<number, any>;
allowanceCache: UseQueryResult<string, any>;
@ -88,9 +35,10 @@ export interface useBottlerArgumentsType {
DiamondAddress: string;
targetChain: any;
}
const diamondJSON = require("../../../../build/contracts/Diamond.json");
const terminusFacetJSON = require("../../../../build/contracts/TerminusFacet.json");
const moonstreamTokenFaucetJSON = require("../../../../build/contracts/MoonstreamTokenFaucet.json");
// const diamondJSON = require("../../../../build/contracts/Diamond.json");
const terminusFacetJSON = require("../../../abi/TerminusFacet.json");
const ownershipFacetJSON = require("../../../abi/OwnershipFacet.json");
// const moonstreamTokenFaucetJSON = require("../../../../build/contracts/MoonstreamTokenFaucet.json");
const useTerminus = ({
DiamondAddress,
targetChain,
@ -100,28 +48,35 @@ const useTerminus = ({
React.useEffect(() => {
if (!contracts["terminusFacet"]) {
console.log("terminusFacetJSON.abi", terminusFacetJSON.abi);
dispatchContracts({
key: "terminusFacet",
abi: terminusFacetJSON.abi, //Facet abi
abi: terminusFacetJSON, //Facet abi
address: DiamondAddress, // Diamond address
});
}
if (!contracts["ownershipFacet"]) {
dispatchContracts({
key: "ownershipFacet",
abi: ownershipFacetJSON, //Facet abi
address: DiamondAddress, // Diamond address
});
}
}, [contracts, DiamondAddress, targetChain, dispatchContracts]);
const _poolBasePrice = async () => {
const terminusDiamond = contracts["terminusFacet"] as TerminusFacet;
// console.debug("start _tcall", terminusDiamond.methods.);
const response = await terminusDiamond.methods.poolBasePrice().call();
return response;
};
const terminusFacetCache = useQuery(
["terminusFacet", DiamondAddress],
getTerminusFacetState(contracts["terminusFacet"], web3Provider.account),
getTerminusFacetState(
{
terminusFacet: contracts["terminusFacet"],
ownershipFacet: contracts["ownershipFacet"],
},
web3Provider.account
),
{
onSuccess: () => {},
enabled:
!!contracts["ownershipFacet"] &&
!!contracts["terminusFacet"] &&
web3Provider.web3?.utils.isAddress(web3Provider.account) &&
web3Provider.chainId === targetChain.chainId,
}
@ -176,8 +131,6 @@ const useTerminus = ({
}
);
const [awaitingAllowance, setAwaitingAllowance] = React.useState(false);
const [awaitingCapcity, setAwaitingCapacity] = React.useState<string>("");
const handleCreateNewPool = async (capacity: string) => {
if (
terminusPaymentTokenCache.data?.allowance &&
@ -208,37 +161,9 @@ const useTerminus = ({
}
};
React.useEffect(() => {
if (
awaitingAllowance &&
!terminusPaymentTokenCache.isLoading &&
!approveTerminusMutation.isLoading
) {
if (
terminusPaymentTokenCache.data?.allowance &&
terminusFacetCache.data?.poolBasePrice
) {
if (
terminusPaymentTokenCache.data.allowance >=
terminusFacetCache.data.poolBasePrice
) {
// createPoolMutation.mutate({ capacity: awaitingCapcity });
createSimplePool(contracts["terminusFacet"], {
from: web3Provider.account,
});
}
}
}
}, [
awaitingAllowance,
terminusPaymentTokenCache.isLoading,
terminusPaymentTokenCache.data,
approveTerminusMutation.isLoading,
]);
const createPoolMutation = useMutation(handleCreateNewPool, {
onSuccess: (resp) => {
console.log("createSimplePool success:", resp);
console.log("createPoolMutation success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
@ -246,12 +171,124 @@ const useTerminus = ({
},
});
const transferTerminusOwnershipMutation = useMutation(
transferTerminusOwnership(contracts["ownershipFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("transferTerminusOwnershipMutation success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
const setTerminusController = useMutation(
setController(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("setTerminusController success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
const withrawPayments = useMutation(
withrawTerminusFunds(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("withrawPayments success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
const setPoolBasePrice = useMutation(
setTerminusPoolBasePrice(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("setPoolBasePrice success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
const setURI = useMutation(
setTerminusURI(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("setURI success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
const setPoolURI = useMutation(
setTerminusPoolURI(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("setPoolURI success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
const setPaymentToken = useMutation(
setTerminusPaymentToken(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSuccess: (resp) => {
console.log("setPaymentToken success:", resp);
},
onSettled: () => {
terminusFacetCache.refetch();
terminusPaymentTokenCache.refetch();
},
}
);
return {
terminusFacetCache,
createPoolMutation,
approveTerminusMutation,
terminusPaymentTokenCache,
handleCreateNewPool,
transferTerminusOwnershipMutation,
withrawPayments,
setTerminusController,
setPoolBasePrice,
setPoolURI,
setURI,
setPaymentToken,
};
};

Wyświetl plik

@ -5,7 +5,12 @@ import { web3MethodCall } from "../providers/Web3Provider/context";
import useWeb3MethodCall from "./useWeb3MethodCall";
import DataContext from "../providers/DataProvider/context";
import BN from "bn.js";
import { useQuery, useQueryClient, UseQueryResult } from "react-query";
import {
useMutation,
useQuery,
useQueryClient,
UseQueryResult,
} from "react-query";
import { queryCacheProps } from "./hookCommon";
// import { }
// import { bottler } from ...
@ -14,7 +19,14 @@ import { DiamondLoupeFacet } from "../../../contracts/DiamondLoupeFacet";
import { DiamondCutFacet } from "../../../contracts/DiamondCutFacet";
import { OwnershipFacet } from "../../../contracts/OwnershipFacet";
import { TerminusFacet } from "../../../contracts/TerminusFacet";
import { getTerminusFacetPoolState } from "../contracts/terminus.contracts";
import {
getTerminusFacetPoolState,
mintNewAccessToken,
setTerminusPoolController,
} from "../contracts/terminus.contracts";
import useTerminus from "./useTerminus";
import { string } from "yargs";
import { terminus } from "../services";
export interface useTerminusPoolArgumentsType {
DiamondAddress: string;
@ -31,6 +43,11 @@ const useTerminusPool = ({
const { contracts, dispatchContracts } = useContext(DataContext);
const web3Provider = useContext(Web3Context);
const terminus = useTerminus({
DiamondAddress: DiamondAddress,
targetChain: targetChain,
});
React.useEffect(() => {
if (!contracts["terminusFacet"]) {
dispatchContracts({
@ -48,15 +65,41 @@ const useTerminusPool = ({
onSuccess: () => {
console.debug("succ");
},
refetchInterval: 100000,
refetchInterval: 1000000,
staleTime: Infinity,
enabled:
!!terminus.terminusFacetCache.data?.paymentToken &&
!!contracts["terminusFacet"] &&
web3Provider.web3?.utils.isAddress(web3Provider.account) &&
web3Provider.chainId === targetChain.chainId,
}
);
return { terminusFacetCache };
const mintPoolNFTMutation = useMutation(
mintNewAccessToken(contracts["terminusFacet"], {
from: web3Provider.account,
}),
{
onSettled: () => {
terminus.terminusFacetCache.refetch();
terminusFacetCache.refetch();
},
}
);
const setPoolController = useMutation(
setTerminusPoolController(contracts["terminusFacet"], poolId, {
from: web3Provider.account,
}),
{
onSettled: () => {
terminus.terminusFacetCache.refetch();
terminusFacetCache.refetch();
},
}
);
return { terminusFacetCache, mintPoolNFTMutation, setPoolController };
};
export default useTerminusPool;

Wyświetl plik

@ -3,9 +3,6 @@ import DataContext, { ContractsHolder } from "./context";
import { Contract } from "web3-eth-contract";
import Web3Context from "../Web3Provider/context";
import BN from "bn.js";
const erc20abi = require("../../../../abi/erc20.json");
const bottlerAbi = require("../../../../abi/bottlerAbi.json");
const terminusDiamondAbi = require("../../../../../build/contracts/Diamond.json");
type Reducer<S, A> = (prevState: S, action: A) => S;

Wyświetl plik

@ -1,10 +1,4 @@
import React, {
useState,
useLayoutEffect,
useContext,
Suspense,
useEffect,
} from "react";
import React, { useState, useLayoutEffect, useContext, Suspense } from "react";
import OverlayContext from "./context";
import { MODAL_TYPES, DRAWER_TYPES } from "./constants";
import {
@ -34,7 +28,6 @@ import {
} from "@chakra-ui/react";
import UserContext from "../UserProvider/context";
import UIContext from "../UIProvider/context";
import useDashboard from "../../hooks/useDashboard";
import SignUp from "../../../components/SignUp";
const ForgotPassword = React.lazy(() =>
import("../../../components/ForgotPassword")
@ -49,7 +42,6 @@ const NewSubscription = React.lazy(() =>
);
const OverlayProvider = ({ children }) => {
const { createDashboard } = useDashboard();
const ui = useContext(UIContext);
const { user } = useContext(UserContext);
const [modal, toggleModal] = useState({
@ -119,11 +111,6 @@ const OverlayProvider = ({ children }) => {
window.sessionStorage.removeItem("new_dashboard");
};
useEffect(() => {
if (createDashboard.isSuccess) {
finishNewDashboard();
}
}, [createDashboard.isSuccess]);
return (
<OverlayContext.Provider
value={{ modal, toggleModal, drawer, toggleDrawer, toggleAlert }}
@ -230,81 +217,6 @@ const OverlayProvider = ({ children }) => {
</ModalBody>
</ModalContent>
</Modal>
{/* )} */}
<Drawer
trapFocus={false}
isOpen={drawerDisclosure.isOpen}
placement="right"
size="xl"
// w="80%"
initialFocusRef={firstField}
onClose={() => toggleAlert(() => finishNewDashboard())}
>
<DrawerOverlay />
<DrawerContent overflowY="scroll">
<DrawerCloseButton />
<DrawerHeader borderBottomWidth="1px">
{DRAWER_TYPES.NEW_DASHBOARD && "New dashboard"}
</DrawerHeader>
<DrawerBody h="auto">
{DRAWER_TYPES.NEW_DASHBOARD && (
<Suspense fallback={<Spinner />}>
<NewDashboard firstField={firstField} />
</Suspense>
)}
</DrawerBody>
<DrawerFooter borderTopWidth="1px">
<Button
variant="outline"
mr={3}
onClick={() => toggleAlert(() => finishNewDashboard())}
>
Cancel
</Button>
<Button
colorScheme="blue"
isLoading={createDashboard.isLoading}
onClick={() => {
const dashboardState = JSON.parse(
sessionStorage.getItem("new_dashboard")
);
createDashboard.mutate({
name: dashboardState.name,
subscriptions: dashboardState.subscriptions.map(
(pickedSubscription) => {
const retval = {
subscription_id: pickedSubscription.subscription_id,
generic: [],
all_methods: !!pickedSubscription.isMethods,
all_events: !!pickedSubscription.isEvents,
};
pickedSubscription.generic.transactions.in &&
retval.generic.push({ name: "transactions_in" });
pickedSubscription.generic.transactions.out &&
retval.generic.push({ name: "transactions_out" });
pickedSubscription.generic.value.in &&
retval.generic.push({ name: "value_in" });
pickedSubscription.generic.value.out &&
retval.generic.push({ name: "value_out" });
pickedSubscription.generic.balance &&
retval.generic.push({ name: "balance" });
retval["methods"] = [];
retval["events"] = [];
return retval;
}
),
});
}}
>
Submit
</Button>
</DrawerFooter>
</DrawerContent>
</Drawer>
{children}
</OverlayContext.Provider>
);

Wyświetl plik

@ -137,6 +137,11 @@ const Web3Provider = ({ children }: { children: JSX.Element }) => {
}, [chainId, web3.currentProvider, web3?.eth]);
window?.ethereum?.on("chainChanged", () => window.location.reload());
window?.ethereum?.on("accountsChanged", (_accounts: Array<string>) => {
if (chainId === targetChain.chainId && web3.currentProvider) {
setAccount(web3.utils.toChecksumAddress(_accounts[0]));
}
});
React.useLayoutEffect(() => {
if (web3.currentProvider && chainId) {

Wyświetl plik

@ -0,0 +1,47 @@
import { http } from "../utils";
const API = process.env.NEXT_PUBLIC_APP_API_URL;
export const getPoolState = (DiamondAddress, poolId) => (query) =>
http({
method: "GET",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/`,
params: query,
});
export const setPoolAddress =
(DiamondAddress, poolId) =>
({ address, allowance, kyc, notes }) => {
const data = new FormData();
address && data.append("address", address);
allowance && data.append("allowance", allowance);
kyc && data.append("kyc", kyc);
notes && data.append("kyc", notes);
return http({
method: "PUT",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/`,
data,
});
};
export const forceChainSync = (DiamondAddress, poolId) =>
http({
method: "GET",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/syncplz`,
});
export const newControllerAccessToken =
(DiamondAddress, poolId) => (signature) => {
const data = new FormData();
data.append("signature", signature);
return http({
method: "POST",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/token`,
data,
});
};
export const authWithAddress = (DiamondAddress, poolId) =>
http({
method: "GET",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/auth/quest`,
});

Wyświetl plik

@ -17,6 +17,7 @@ const RootLayout = (props) => {
w="100%"
h="100%"
maxH="100%"
bgColor={"blue.1200"}
>
<Suspense fallback="">
<Sidebar />