pull/40/head
Tim Pechersky 2022-03-16 14:33:49 +00:00
rodzic 517ff1ab35
commit 3eaffa946c
34 zmienionych plików z 5575 dodań i 240 usunięć

Wyświetl plik

@ -0,0 +1,6 @@
#!/bin/bash
for f in ../../build/contracts/*.json ;
do
cat $f | jq -j ".abi" > abi/$(basename ${f})
done

Wyświetl plik

@ -6,8 +6,10 @@
"scripts": {
"build": "./node_modules/.bin/tsc",
"server": "./node_modules/.bin/tsc && node build/index.js",
"dev": "nodemon --watch 'src/**/*' -e ts,tsx --exec ts-node ./src/index.ts",
"test": "echo \"Error: no test specified\" && exit 1",
"tsc": "node_modules/.bin/tsc"
"tsc": "node_modules/.bin/tsc",
"generate_classes": "typechain --target=web3-v1 --out-dir types/contracts '../../build/contracts/*.json'"
},
"repository": {
"type": "git",
@ -25,18 +27,25 @@
},
"homepage": "https://github.com/bugout-dev/dao#readme",
"devDependencies": {
"@typechain/web3-v1": "^5.0.0",
"@types/uuid": "^8.3.4",
"@types/web3": "^1.2.2",
"nodemon": "^2.0.15",
"prettier": "^2.5.1",
"ts-node": "^10.7.0",
"typechain": "^7.0.1",
"typescript": "^4.5.5"
},
"dependencies": {
"@bugout/bugout-js": "^0.0.13",
"@bugout/bugout-js": "^0.0.16",
"@koa/cors": "^3.1.0",
"@koa/multer": "^3.0.0",
"@koa/router": "^10.1.1",
"@types/koa__cors": "^3.1.1",
"@types/koa__router": "^8.0.11",
"axios": "^0.26.0",
"koa": "^2.13.4",
"uuid": "^8.3.2",
"web3": "^1.7.0"
}
}

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

@ -0,0 +1,417 @@
[
{
"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": [
{
"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"
},
{
"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

@ -0,0 +1,290 @@
[
{
"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": [],
"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,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

@ -0,0 +1,819 @@
[
{
"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": [
{
"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": "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": "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": "address",
"name": "owner",
"type": "address"
}
],
"name": "totalPoolsByOwner",
"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,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

@ -1,84 +1,117 @@
import Koa from "koa";
import Router from "@koa/router";
import cors from "@koa/cors";
import axios from "axios";
import web3 from "web3";
import * as fs from 'fs';
import * as path from 'path';
import axios, { Axios, AxiosError, AxiosResponse } from "axios";
import Web3 from "web3";
import * as fs from "fs";
import * as path from "path";
import BugoutClient, {
BugoutResponseError,
BugoutTypes,
} from "@bugout/bugout-js";
import * as TerminusFacet from "./abi/TerminusFacet.json";
import { BugoutResources } from "@bugout/bugout-js/lib/types";
import { v4 } from "uuid";
const TERMINUS_APPLICATION_PORT =
process.env.TERMINUS_APPLICATION_PORT || 14601;
if (!process.env.TERMINUS_APPLICATION_ID)
throw "TERMINUS_APPLICATION_ID not provided";
const app = new Koa();
const router = new Router();
const corsConfiguration = cors({ allowMethods: "GET" });
const TERMINUS_APPLICATION_PORT = process.env.TERMINUS_APPLICATION_PORT || 14601;
const TERMINUS_APPLICATION_ID = process.env.TERMINUS_APPLICATION_ID || "";
const TERMINUS_APPLICATION_ID = process.env.TERMINUS_APPLICATION_ID;
const BROOD_AUTH_URL = process.env.BROOD_AUTH_URL || "https://auth.bugout.dev";
const BROOD_AUTH_TOKEN = process.env.BROOD_AUTH_TOKEN;
if (!BROOD_AUTH_TOKEN) throw "BROOD_AUTH_TOKEN is not exported";
const multer = require("@koa/multer");
const app = new Koa();
const data = multer();
const router = new Router();
const corsConfiguration = cors({ allowMethods: "GET" });
const web3 = new Web3(`https://rpc-mainnet.matic.network`);
const TERMINUS_CONTRACT_TYPE = "terminus_contract_type";
const TERMINUS_CLIENT_TYPE = "terminus_client_type";
const WEB3_ADDRESS = "web3_address_type";
const bc = new BugoutClient(BROOD_AUTH_URL);
bc.pingBrood().then((response: BugoutTypes.BugoutPing) =>
console.log(`ping brood:`, response)
);
const BUGOUT_RESOURCE_TYPE_SUBSCRIPTION = "subscription";
export type BugoutUser = {
id: string
username: string
first_name?: string
last_name?: string
email?: string
normalized_email?: string
verified?: string
autogenerated?: string
application_id?: string
created_at?: string
updated_at?: string
}
id: string;
username: string;
first_name?: string;
last_name?: string;
email?: string;
normalized_email?: string;
verified?: string;
autogenerated?: string;
application_id?: string;
created_at?: string;
updated_at?: string;
};
export function userUnpacker(response: any): BugoutUser {
return {
id: response.user_id,
username: response.username,
first_name: response.first_name,
last_name: response.last_name,
email: response.email,
normalized_email: response.normalized_email,
application_id: response.application_id,
verified: response.verified,
created_at: response.created_at,
updated_at: response.updated_at
} as BugoutUser
id: response.user_id,
username: response.username,
first_name: response.first_name,
last_name: response.last_name,
email: response.email,
normalized_email: response.normalized_email,
application_id: response.application_id,
verified: response.verified,
created_at: response.created_at,
updated_at: response.updated_at,
} as BugoutUser;
}
interface Address {
id: string;
chainId: string;
address: string;
token_hash: string; //hash of access token
customer_id: string; //foreign key to customer.id
}
interface Customer {
id: string // primary key we use to refer to customer in DB
name: string // name of customer
notes: string // human-readable/writeable notes about customer
id: string; // primary key we use to refer to customer in DB
name: string; // name of customer
notes: string; // human-readable/writeable notes about customer
}
interface Contract {
id: string // primary key we use to refer to contract in DB
blockchain: string // chain which Terminus contract is deployed
address: string // address of the contract on that blockchain
customer_id: string // foreign key to Customer.id
controller: string // address of Terminus controller
name: string // human friendly name for contract
notes: string // human friendly notes about contract
id: string; // primary key we use to refer to contract in DB
blockchain: string; // chain which Terminus contract is deployed
address: string; // address of the contract on that blockchain
customer_id: string; // foreign key to Customer.id
controller: string; // address of Terminus controller
name: string; // human friendly name for contract
notes: string; // human friendly notes about contract
}
interface PoolAuthorization {
id: string // primary key
pool_id: string // foreign key into Pool.id
address: string // authorized address for pool
id: string; // primary key
pool_id: string; // foreign key into Pool.id
address: string; // authorized address for pool
}
interface PoolOwner {
id: string // primary key
pool_id: string // foreign key into Pool.id
address: string // address of token owner
num_tokens: string // number of tokens they own
id: string; // primary key
pool_id: string; // foreign key into Pool.id
address: string; // address of token owner
num_tokens: string; // number of tokens they own
}
interface AddressAnnotation {
address: string
annotator: string // address of account that created annotation
name: string // name for address
notes: string // notes for address
address: string;
annotator: string; // address of account that created annotation
name: string; // name for address
notes: string; // notes for address
}
interface StatusResponse {
@ -86,127 +119,279 @@ interface StatusResponse {
nextRefresh: number;
}
interface CountAddressesResponse {
addresses: number;
}
interface CountUNIMResponse {
balance: number;
}
interface QuartilesResponse {
persent_25: LeaderboardItem;
persent_50: LeaderboardItem;
persent_75: LeaderboardItem;
}
interface LeaderboardItem {
address: string;
balance: number;
}
interface LeaderboardResponse {
blockNumber: number;
blockTimestamp: number;
leaderboard: Array<LeaderboardItem>;
offset: number;
limit: number;
}
const toTimestamp = (strDate: string) => {
const dt = Date.parse(strDate);
return dt / 1000;
};
async function checkAuth(ctx: Koa.BaseContext, next: ()=>Promise<any>) {
//Error middleware
router.use(async (ctx, next) => {
try {
await next();
} catch (err: any) {
let message = err.response?.data?.detail || err.message || "Unknown Error";
let status = err?.response?.status || err?.statusCode || err?.status || 500;
console.log("***************************");
console.log("Middleware catched an error:", status);
console.log(message);
console.log("***************************");
ctx.throw(status, message);
}
});
// const getContract =
// (ctx: Koa.BaseContext, next: () => Promise<any>) =>
// async (address: string) => {
// if (!web3.utils.isAddress(address)) {
// ctx.status = 422;
// ctx.body = { error: "Is not address" };
// } else {
// const token = ctx.headers.authorization ?? "";
// const resource = await bc
// .listResources(token, { contract_address: address })
// .then((response: BugoutTypes.BugoutResources) => response.resources[0])
// .then(async (resource) => {
// const terminus_resource = await bc.getResource(token, resource.id);
// });
// ctx.status = 200;
// ctx.body = terminus_resource;
// }
// next();
// };
async function checkAuth(ctx: Koa.BaseContext, next: () => Promise<any>) {
if (ctx.headers["authorization"]) {
const user_token_list = ctx.headers["authorization"].split(" ");
if (user_token_list.length != 2) {
ctx.status = 403;
ctx.body = {"error": "Wrong authorization header"};
ctx.body = { error: "Wrong authorization header" };
} else {
try{
let url = `${BROOD_AUTH_URL}/user`
try {
let url = `${BROOD_AUTH_URL}/user`;
const response = await axios.get(url, {
headers: { authorization: `Bearer ${user_token_list[1]}` },
});
const user = userUnpacker(response.data)
const user = userUnpacker(response.data);
if (!user.verified) {
console.log(`Attempted journal access by unverified Brood account: ${user.id}`)
console.log(
`Attempted journal access by unverified Brood account: ${user.id}`
);
ctx.status = 403;
ctx.body = {"error": "Wrong authorization header"};
ctx.body = { error: "Wrong authorization header" };
} else {
if (user.application_id != TERMINUS_APPLICATION_ID) {
ctx.status = 403;
ctx.body = {"error": "User does not belong to this application"};
ctx.body = { error: "User does not belong to this application" };
} else {
await next();
}
}
} catch(Error: any) {
} catch (Error: any) {
console.log(Error);
ctx.status = 404;
ctx.body = {"error": `Credential not found`};
ctx.body = { error: `Credential not found` };
}
}
} else {
ctx.status = 404;
ctx.body = {"error": "Authorization header not found"};
ctx.body = { error: "Authorization header not found" };
}
}
router.use(["/update"], checkAuth);
// router.use(["/update"], checkAuth);
// async function syncBucket(app: any) {
// // Request data update
// let url = `https://s3.amazonaws.com/static.simiotics.com/LEADERBOARD_DATA/IMDEX_FILE.json`;
// // Post will return access link response structure
// // {"url": presign_url}
// let response = await axios.get(url, {
// headers: { "Content-Type": "application/json" },
// });
async function syncBucket(app: any) {
// Request data update
let url = `https://s3.amazonaws.com/static.simiotics.com/LEADERBOARD_DATA/IMDEX_FILE.json`;
// app.context.index_data = await response.data;
// Post will return access link response structure
// {"url": presign_url}
let response = await axios.get(url, {
headers: { "Content-Type": "application/json" },
});
// // Request data update
// url = `https://s3.amazonaws.com/static.simiotics.com/LEADERBOARD_DATA/FULL_LIST.json`;
app.context.index_data = await response.data;
// // Post will return access link response structure
// // {"url": presign_url}
// response = await axios.get(url, {
// headers: { "Content-Type": "application/json" },
// });
// Request data update
url = `https://s3.amazonaws.com/static.simiotics.com/LEADERBOARD_DATA/FULL_LIST.json`;
// app.context.full_data = await response.data;
// app.context.last_modified = response.headers["last-modified"];
// console.log("synchronized");
// }
// Post will return access link response structure
// {"url": presign_url}
response = await axios.get(url, {
headers: { "Content-Type": "application/json" },
});
// syncBucket(app);
app.context.full_data = await response.data;
app.context.last_modified = response.headers["last-modified"];
console.log("synchronized");
}
router.get("/web3auth/:chainId/:address", async (ctx, next) => {
const web3 = new Web3();
const { address, chainId } = ctx.params;
const quest = web3.utils.keccak256(
address + chainId + String(Math.floor(Date.now() / 60000))
);
ctx.body = { quest: quest };
});
syncBucket(app);
router.post(
"/web3auth/:chainId/:address",
data.single("signature"),
async (ctx, next) => {
const web3 = new Web3();
const { address, chainId } = ctx.params;
const request = ctx.request as any;
const { signature } = request.body;
const quest = web3.utils.keccak256(
address + chainId + String(Math.floor(Date.now() / 60000))
);
const verify = await web3.eth.accounts.recover(quest, signature);
if (address == verify) {
// await next()
const listResources = await bc.listResources(BROOD_AUTH_TOKEN, {
blockchain: chainId,
address: address,
type: WEB3_ADDRESS,
});
if (listResources.resources.length === 0) {
const newToken = v4();
const resourceData = {
id: v4(),
address: address,
chainId: chainId,
token_hash: web3.utils.keccak256(newToken),
};
await bc.createResource(
BROOD_AUTH_TOKEN,
TERMINUS_APPLICATION_ID,
resourceData
);
ctx.body = newToken;
} else {
const resource = listResources.resources[0];
const newToken = v4();
const resourceData = {
...resource.resource_data,
token_hash: web3.utils.keccak256(newToken),
};
bc.updateResource(BROOD_AUTH_TOKEN, resource.id, resourceData, []);
ctx.body = newToken;
}
}
}
);
router.get("/terminus/:chainId/:contractAddress", async (ctx, next) => {
const { contractAddress, chainId } = ctx.params;
// const accessLevel = await next(chainId, contractAddress, ctx, next)
// await next();
// const ResourceState =
//
console.log("got ", contractAddress, chainId);
// ctx.body = "lol";
// ctx.satus = 200;
let resources: Array<any> = [];
if (!web3.utils.isAddress(contractAddress)) {
ctx.throw(422, "Is not address");
} else {
console.log("getting contracts list");
// try {
const contractsList = await bc.listResources(BROOD_AUTH_TOKEN, {
blockchain: chainId,
address: contractAddress,
type: TERMINUS_CONTRACT_TYPE,
});
resources = contractsList?.resources;
// } catch (err: any) {
// console.log(err.message);
// }
let terminus_resource;
if (resources.length === 0) {
console.log("got zero resources -> create one...");
let customerId: string | null = "";
try {
const customer = await bc.listResources(BROOD_AUTH_TOKEN, {
type: TERMINUS_CLIENT_TYPE,
address: contractAddress,
blockchain: chainId,
});
customerId =
customer.resources.length > 0 ? customer.resources[0].id : null;
} catch (error: any) {
console.error(error?.message);
}
console.log("Searching for customer id:", customerId);
const newResourceData = {
blockchain: chainId,
address: contractAddress,
customer_id: customerId,
controller: "",
name: "",
notes: "",
type: TERMINUS_CONTRACT_TYPE,
};
console.log("Attempt to create resource", TERMINUS_APPLICATION_ID);
try {
console.log("with token", BROOD_AUTH_TOKEN);
terminus_resource = await bc.createResource(
BROOD_AUTH_TOKEN,
TERMINUS_APPLICATION_ID,
newResourceData
);
} catch (error: any) {
ctx.throw(error.response.status, error.response.data.detail);
}
console.log("checking subscriptions");
const params = {
type: BUGOUT_RESOURCE_TYPE_SUBSCRIPTION,
address: contractAddress,
subscription_type_id: "polygon_blockchain",
};
const listResources = await bc.listResources(BROOD_AUTH_TOKEN, params);
if (listResources.resources.length === 0) {
console.log("no subscriptions found -> create one");
const newResourceData = {
type: BUGOUT_RESOURCE_TYPE_SUBSCRIPTION,
address: contractAddress,
subscription_type_id: "polygon_blockchain",
abi: JSON.stringify(TerminusFacet),
};
await bc.createResource(
BROOD_AUTH_TOKEN,
TERMINUS_APPLICATION_ID,
newResourceData
);
console.log("created subscription");
} else {
console.log("found subscription");
}
} else {
console.log("found resource!", resources[0]);
terminus_resource = await bc.getResource(
BROOD_AUTH_TOKEN,
resources[0].id
);
}
ctx.status = 200;
ctx.body = terminus_resource;
await next();
}
router.get("/terminus/:DiamondAddress", async (ctx) => {
/*
GET /terminus/${DiamondAddress} -> (TerminusContract):
@ -223,110 +408,90 @@ router.get("/terminus/:DiamondAddress", async (ctx) => {
Check web3 -> if contract exists and payment service conditions are met - create resource and set up crawler
*/
});
router.get(
"/terminus/:chainId/:contractAddress/pools/:poolId",
async (ctx, next) => {
console.log("get pool id");
}
);
router.get("/terminus/:DiamondAddress/pools/:poolId", async (ctx) => {
/*
// router.get("/terminus/:DiamondAddress/pools/:poolId", async (ctx) => {
// /*
GET /terminus/${DiamondAddress}/pools/${poolId} -> (TerminusPool):
terminus_pool: BugoutResource = bc.get_resource(
resource_id=terminus_contract[poolId],
)
1. Update resource from web3 provider
2. Return resource
// GET /terminus/${DiamondAddress}/pools/${poolId} -> (TerminusPool):
// terminus_pool: BugoutResource = bc.get_resource(
// resource_id=terminus_contract[poolId],
// )
// 1. Update resource from web3 provider
// 2. Return resource
Case if resource not found:
If payment service conditions are met - create resource and set up crawler.
For each address found in crawler:
add TerminusIdentity.
// Case if resource not found:
// If payment service conditions are met - create resource and set up crawler.
// For each address found in crawler:
// add TerminusIdentity.
*/
// */
// });
});
// router.get("/terminus/:DiamondAddress/pools/:poolId/:address", async (ctx) => {
// /*
// GET /terminus/${DiamondAddress}/pools/${poolId}/${address} -> (TerminusIdentity)
// terminus_pool_resource: BugoutResource = bc.get_resource(
// resource_id=terminus_pool.identities[],
// )
// if address in terminus_pool_resource.identities
// terminus_identity_resource: BugoutResource = bc.get_resource(
// resource_id=address,
// )
// terminus_identity_record_resource: BugoutResource = bc.get_pool_resource(
// resource_id=web3.sha(DiamondAddress + poolId + address),
// )
router.get("/terminus/:DiamondAddress/pools/:poolId/:address", async (ctx) => {
/*
// */
// });
GET /terminus/${DiamondAddress}/pools/${poolId}/${address} -> (TerminusIdentity)
terminus_pool_resource: BugoutResource = bc.get_resource(
resource_id=terminus_pool.identities[],
)
if address in terminus_pool_resource.identities
terminus_identity_resource: BugoutResource = bc.get_resource(
resource_id=address,
)
terminus_identity_record_resource: BugoutResource = bc.get_pool_resource(
resource_id=web3.sha(DiamondAddress + poolId + address),
)
// router.get("/status", async (ctx) => {
// const nowEpoch = toTimestamp(ctx.last_modified);
// const response: StatusResponse = {
// lastRefresh: nowEpoch,
// nextRefresh: nowEpoch + 10800,
// };
// ctx.body = response;
// });
*/
});
router.get("/status", async (ctx) => {
const nowEpoch = toTimestamp(ctx.last_modified);
const response: StatusResponse = {
lastRefresh: nowEpoch,
nextRefresh: nowEpoch + 10800,
};
ctx.body = response;
});
router.get("/position", async (ctx) => {
const windowSizeRaw = ctx.query.window_size ? ctx.query.window_size[0] : "1";
const windowSize = parseInt(windowSizeRaw);
if (ctx.query.address && ctx.index_data["data"].includes(web3.utils.toChecksumAddress(ctx.query.address.toString()))) {
const address = web3.utils.toChecksumAddress(ctx.query.address.toString());
const position = ctx.index_data["data"][address]["position"];
const response = ctx.full_data["data"].slice(
position - windowSize,
position + windowSize + 1
);
ctx.body = response;
} else {
ctx.body = {};
//
router.use(async (ctx, next) => {
//Check user address token
if (ctx.headers["authorization"]) {
const user_token_list = ctx.headers["authorization"].split(" ");
if (user_token_list.length == 2) {
try {
const res = await bc.findFirstResource(BROOD_AUTH_TOKEN, {
type: WEB3_ADDRESS,
token_hash: web3.utils.keccak256(user_token_list[1]),
});
console.log("address found:", res.resource_data.address);
} catch (err) {
const _err = err as BugoutResponseError;
console.log("address resource not found", _err.message);
ctx.throw(404, { message: "Token is invalid" });
}
}
}
});
router.get("/leaderboard", async (ctx) => {
if (ctx.query.offset && ctx.query.offset.toString() != ctx.query.offset) {
ctx.query.offset = ctx.query.offset[0];
}
if (ctx.query.limit && ctx.query.limit.toString() != ctx.query.limit) {
ctx.query.limit = ctx.query.limit[0];
}
const offset: number = parseInt(ctx.query.offset || "0");
const limit: number = parseInt(ctx.query.limit || "10");
const response: LeaderboardResponse = {
blockNumber: ctx.full_data["block_number"],
blockTimestamp: ctx.full_data["block_timestamp"],
leaderboard: ctx.full_data.data.slice(offset, offset + limit),
offset: offset,
limit: limit,
};
ctx.body = response;
});
router.post("/update", async (ctx) => {
syncBucket(app);
ctx.body = "Updating";
});
// router.use(async (ctx, next) => {
// console.log("Payment middleware");
// await next();
// });
app.use(corsConfiguration).use(router.routes());
app.listen(TERMINUS_APPLICATION_PORT, () => {
console.log(
`UNIM Leaderboard server listening on port ${TERMINUS_APPLICATION_PORT}`
`Terminus web app server listening on port ${TERMINUS_APPLICATION_PORT}`
);
});

Wyświetl plik

@ -33,7 +33,7 @@
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
"resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */

Wyświetl plik

@ -15,7 +15,11 @@ import {
setTerminusPaymentToken,
} from "../contracts/terminus.contracts";
import { getTokenState, setAllowance } from "../contracts/ERC20.contracts";
import {
getTerminus,
getweb3Auth,
postweb3Auth,
} from "../services/terminus.service";
export interface useBottlerReturns {
balanceCache: UseQueryResult<number, any>;
allowanceCache: UseQueryResult<string, any>;
@ -29,6 +33,7 @@ export interface useBottlerReturns {
emptyBottlesCache: UseQueryResult<Array<number>, any>;
fullBottlesPricesCache: UseQueryResult<Array<{ matic: number; bn: BN }>, any>;
}
import queryCacheProps from "./hookCommon";
export interface useBottlerArgumentsType {
diamondAddress: string;
@ -62,6 +67,20 @@ const useTerminus = ({
}
}, [contracts, diamondAddress, targetChain, dispatchContracts]);
const terminusFacetCacheW2 = useQuery(
["terminusFacetW2", diamondAddress, targetChain.chainId],
() => getTerminus(diamondAddress, targetChain.chainId),
{
onSuccess: () => {},
...queryCacheProps,
enabled:
web3Provider.web3?.utils.isAddress(web3Provider.account) &&
web3Provider.chainId === targetChain.chainId,
}
);
const terminusFacetCache = useQuery(
["terminusFacet", diamondAddress, targetChain.chainId],
getTerminusFacetState(

Wyświetl plik

@ -10,7 +10,6 @@ import { useStorage, useQuery, useRouter } from "../../hooks";
import UIContext from "./context";
import UserContext from "../UserProvider/context";
import { v4 as uuid4 } from "uuid";
import { PreferencesService } from "../../services";
//TODO: onboardingSteps must be made either generic for any APP, or removed at all for now
const onboardingSteps = [
@ -159,7 +158,6 @@ const UIProvider = ({ children }) => {
const [onboardingState, setOnboardingState] = useState(false);
const [onboardingStep, setOnboardingStep] = useState();
const [onboardingStateInit, setOnboardingStateInit] = useState(false);
const [onboardingRedirectCheckPassed, setOnboardingRedirectCheckPassed] =
useState(false);
@ -170,26 +168,6 @@ const UIProvider = ({ children }) => {
[onboardingState]
);
useEffect(() => {
//If onboarding state not exists - fetch it from backend
//If it exists but init is not set - set init true
//If it exists and is init -> post update to backend
if (!onboardingState && user && !isLoggingOut) {
const currentOnboardingState = async () =>
PreferencesService.getOnboardingState().then((response) => {
return response.data;
});
currentOnboardingState().then((response) => {
setOnboardingState(response);
});
} else if (user && onboardingState && !onboardingStateInit) {
setOnboardingStateInit(true);
} else if (user && onboardingStateInit) {
PreferencesService.setOnboardingState(onboardingState);
}
// eslint-disable-next-line
}, [onboardingState, user]);
useEffect(() => {
//This will set step after state is fetched from backend

Wyświetl plik

@ -1,6 +1,7 @@
import React from "react";
import Web3Context, { WALLET_STATES } from "./context";
import Web3 from "web3";
import { getweb3Auth, postweb3Auth } from "../../services/terminus.service";
declare global {
interface Window {
@ -159,6 +160,40 @@ const Web3Provider = ({ children }: { children: JSX.Element }) => {
}
}, [web3.currentProvider, chainId]);
React.useEffect(() => {
if (
!localStorage.getItem("APP_ACCESS_TOKEN") &&
web3?.utils.isAddress(account)
) {
console.log("x0x entring");
getweb3Auth(account, chainId).then(async (resp: any) => {
// console.log("resp", resp?.data.quest);
const quest = resp?.data.quest;
console.log("x0x got quest", quest);
const signature = await window.ethereum.request({
method: "personal_sign",
params: [quest, account],
});
// const signature = await web3Provider.web3.eth.personal.sign(
// data.data.quest,
// web3Provider.account
// );
const response = await postweb3Auth(
account,
targetChain.chainId
)(signature);
console.log("token:", response.data);
const token = response.data;
if (token) {
console.log("x0x got token");
localStorage.setItem("APP_ACCESS_TOKEN", token);
}
});
}
}, [account, chainId, web3.utils]);
return (
<Web3Context.Provider
value={{

Wyświetl plik

@ -1,10 +1,18 @@
import { http } from "../utils";
const API = process.env.NEXT_PUBLIC_APP_API_URL;
export const getTerminus = (diamondAddress, chainId) => {
console.log("API", API);
return http({
method: "GET",
url: `${API}/terminus/${chainId}/${diamondAddress}`,
});
};
export const getPoolState = (DiamondAddress, poolId) => (query) =>
http({
method: "GET",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/`,
url: `${API}/terminus/${DiamondAddress}/${poolId}/`,
params: query,
});
@ -45,3 +53,19 @@ export const authWithAddress = (DiamondAddress, poolId) =>
method: "GET",
url: `${API}/terminus/${DiamondAddress}/pools/${poolId}/auth/quest`,
});
export const getweb3Auth = (address, chainId) =>
http({
method: "GET",
url: `${API}/web3auth/${chainId}/${address}/`,
});
export const postweb3Auth = (address, chainId) => (signature) => {
const data = new FormData();
data.append("signature", signature);
return http({
method: "POST",
url: `${API}/web3auth/${chainId}/${address}/`,
data,
});
};

Wyświetl plik

@ -0,0 +1,819 @@
[
{
"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": [
{
"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": "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": "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": "address",
"name": "owner",
"type": "address"
}
],
"name": "totalPoolsByOwner",
"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"
}
]