parent
01e2a33021
commit
f04fe156ac
@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
contracts
|
||||
.env.local
|
||||
.env
|
||||
build
|
||||
coverage
|
||||
__mocks__
|
@ -0,0 +1,9 @@
|
||||
FROM node:16
|
||||
|
||||
COPY package*.json /usr/src/app/
|
||||
WORKDIR /usr/src/app
|
||||
RUN npm install
|
||||
|
||||
COPY . /usr/src/app
|
||||
ENV DEPLOY_SUBGRAPH=true
|
||||
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
|
File diff suppressed because one or more lines are too long
@ -1,314 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "BMath",
|
||||
"sourceName": "contracts/pools/balancer/BMath.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "swapFeeAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "oceanFeeAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "marketFeeAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "tokenFees",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "SWAP_FEES",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "BONE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "BPOW_PRECISION",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "EXIT_FEE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "INIT_POOL_SUPPLY",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_BOUND_TOKENS",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_BPOW_BASE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_FEE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_IN_RATIO",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_OUT_RATIO",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_TOTAL_WEIGHT",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MAX_WEIGHT",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MIN_BALANCE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MIN_BOUND_TOKENS",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MIN_BPOW_BASE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MIN_FEE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MIN_WEIGHT",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "_swapPublishMarketFee",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "communityFees",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getOPCFee",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "publishMarketFees",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405234801561001057600080fd5b50610451806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063992e2a92116100ad578063bc694ea211610071578063bc694ea2146101eb578063c36596a614610153578063c6580d12146101f3578063e4a28a5214610131578063ec093021146101fb57600080fd5b8063992e2a92146101cb578063b0e0d136146101d3578063b7b800a4146101d3578063ba019dab146101db578063bc063e1a146101e357600080fd5b806376c7a3c7116100f457806376c7a3c71461018a5780637a284be4146101925780637c5918b31461019b578063867378c5146101bb5780639381cd2b146101c357600080fd5b806309a3bbe414610131578063189d00ca1461014b578063218b53821461015357806329b88a6a14610162578063300621921461016a575b600080fd5b610139610203565b60405190815260200160405180910390f35b610139610219565b610139670de0b6b3a764000081565b610139610230565b61013961017836600461034c565b60056020526000908152604090205481565b6101396102aa565b61013960005481565b6101396101a936600461034c565b60066020526000908152604090205481565b6101396102bf565b6101396102d6565b6101396102e9565b610139600281565b610139600181565b610139610307565b61013961031a565b610139600081565b610139610339565b610216670de0b6b3a76400006032610392565b81565b6102166402540be400670de0b6b3a76400006103b1565b6002546004805460405163b8421e2b60e01b81526001600160a01b0391821692810192909252600092169063b8421e2b90602401602060405180830381865afa158015610281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a591906103d3565b905090565b610216620f4240670de0b6b3a76400006103b1565b61021664e8d4a51000670de0b6b3a76400006103b1565b610216670de0b6b3a76400006064610392565b6102fc6003670de0b6b3a76400006103b1565b6102169060016103ec565b610216600a670de0b6b3a76400006103b1565b600161032f670de0b6b3a76400006002610392565b6102169190610404565b6102166002670de0b6b3a76400006103b1565b60006020828403121561035e57600080fd5b81356001600160a01b038116811461037557600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156103ac576103ac61037c565b500290565b6000826103ce57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156103e557600080fd5b5051919050565b600082198211156103ff576103ff61037c565b500190565b6000828210156104165761041661037c565b50039056fea2646970667358221220bb7675d200528b1ac138059c595a95fd2adb2b36b61e0bac3f6baeafc4fc887c64736f6c634300080a0033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063992e2a92116100ad578063bc694ea211610071578063bc694ea2146101eb578063c36596a614610153578063c6580d12146101f3578063e4a28a5214610131578063ec093021146101fb57600080fd5b8063992e2a92146101cb578063b0e0d136146101d3578063b7b800a4146101d3578063ba019dab146101db578063bc063e1a146101e357600080fd5b806376c7a3c7116100f457806376c7a3c71461018a5780637a284be4146101925780637c5918b31461019b578063867378c5146101bb5780639381cd2b146101c357600080fd5b806309a3bbe414610131578063189d00ca1461014b578063218b53821461015357806329b88a6a14610162578063300621921461016a575b600080fd5b610139610203565b60405190815260200160405180910390f35b610139610219565b610139670de0b6b3a764000081565b610139610230565b61013961017836600461034c565b60056020526000908152604090205481565b6101396102aa565b61013960005481565b6101396101a936600461034c565b60066020526000908152604090205481565b6101396102bf565b6101396102d6565b6101396102e9565b610139600281565b610139600181565b610139610307565b61013961031a565b610139600081565b610139610339565b610216670de0b6b3a76400006032610392565b81565b6102166402540be400670de0b6b3a76400006103b1565b6002546004805460405163b8421e2b60e01b81526001600160a01b0391821692810192909252600092169063b8421e2b90602401602060405180830381865afa158015610281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a591906103d3565b905090565b610216620f4240670de0b6b3a76400006103b1565b61021664e8d4a51000670de0b6b3a76400006103b1565b610216670de0b6b3a76400006064610392565b6102fc6003670de0b6b3a76400006103b1565b6102169060016103ec565b610216600a670de0b6b3a76400006103b1565b600161032f670de0b6b3a76400006002610392565b6102169190610404565b6102166002670de0b6b3a76400006103b1565b60006020828403121561035e57600080fd5b81356001600160a01b038116811461037557600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156103ac576103ac61037c565b500290565b6000826103ce57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156103e557600080fd5b5051919050565b600082198211156103ff576103ff61037c565b500190565b6000828210156104165761041661037c565b50039056fea2646970667358221220bb7675d200528b1ac138059c595a95fd2adb2b36b61e0bac3f6baeafc4fc887c64736f6c634300080a0033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,234 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ERC20Roles",
|
||||
"sourceName": "contracts/utils/ERC20Roles.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "signer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "AddedMinter",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "signer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "AddedPaymentManager",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "signer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "CleanedPermissions",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "signer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "RemovedMinter",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "signer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "RemovedPaymentManager",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "authERC20",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getPermissions",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "minter",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "paymentManager",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"internalType": "struct ERC20Roles.RolesERC20",
|
||||
"name": "",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "permissions",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "minter",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "paymentManager",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405234801561001057600080fd5b506101df806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806301e8820814610046578063160a79251461008e578063ef867ff41461010b575b600080fd5b610072610054366004610160565b60006020819052908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b6100ec61009c366004610160565b6040805180820190915260008082526020820152506001600160a01b03166000908152602081815260409182902082518084019093525460ff808216151584526101009091041615159082015290565b6040805182511515815260209283015115159281019290925201610085565b61011e610119366004610190565b610136565b6040516001600160a01b039091168152602001610085565b6001818154811061014657600080fd5b6000918252602090912001546001600160a01b0316905081565b60006020828403121561017257600080fd5b81356001600160a01b038116811461018957600080fd5b9392505050565b6000602082840312156101a257600080fd5b503591905056fea2646970667358221220ccf3df6db224ddd4890801a3179ede2341d3b79e67297621cef6008f522b4b9e64736f6c634300080a0033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806301e8820814610046578063160a79251461008e578063ef867ff41461010b575b600080fd5b610072610054366004610160565b60006020819052908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b6100ec61009c366004610160565b6040805180820190915260008082526020820152506001600160a01b03166000908152602081815260409182902082518084019093525460ff808216151584526101009091041615159082015290565b6040805182511515815260209283015115159281019290925201610085565b61011e610119366004610190565b610136565b6040516001600160a01b039091168152602001610085565b6001818154811061014657600080fd5b6000918252602090912001546001600160a01b0316905081565b60006020828403121561017257600080fd5b81356001600160a01b038116811461018957600080fd5b9392505050565b6000602082840312156101a257600080fd5b503591905056fea2646970667358221220ccf3df6db224ddd4890801a3179ede2341d3b79e67297621cef6008f522b4b9e64736f6c634300080a0033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# default to true in case it is not set
|
||||
DEPLOY_SUBGRAPH="${DEPLOY_SUBGRAPH:-true}"
|
||||
echo "deploy subgraph is ${DEPLOY_SUBGRAPH}"
|
||||
|
||||
if [ "${DEPLOY_SUBGRAPH}" = "true" ]
|
||||
then
|
||||
echo "Waiting for contracts to be deployed"
|
||||
while [ ! -f "/ocean-contracts/artifacts/ready" ]; do
|
||||
sleep 2
|
||||
done
|
||||
export ADDRESS_FILE="/ocean-contracts/artifacts/address.json"
|
||||
/usr/src/app/
|
||||
npm run quickstart:barge
|
||||
fi
|
||||
tail -f /dev/null
|
File diff suppressed because it is too large
Load Diff
@ -1,57 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
var fs = require('fs')
|
||||
|
||||
async function replaceContractAddresses() {
|
||||
// load barge addresses first
|
||||
try {
|
||||
// const data = JSON.parse(
|
||||
// fs.readFileSync(
|
||||
// '/home/mihai/.ocean/ocean-contracts/artifacts/address.json',
|
||||
// 'utf8'
|
||||
// )
|
||||
// )
|
||||
// const {
|
||||
// DTFactory,
|
||||
// // eslint-disable-next-line no-unused-vars
|
||||
// ERC721Factory
|
||||
// } = data.development
|
||||
// let subgraph = fs.readFileSync('subgraph.yaml', 'utf8')
|
||||
// if (!data) {
|
||||
// return false
|
||||
// }
|
||||
|
||||
const ERC721Factory = '0x0599a4a2873B38D836E10302De1ca4834F7BDF4E'
|
||||
const FixedRateExchange = '0x2356DeCd8CFB6c6f2bf46b5ED4531818B4662337'
|
||||
const Dispenser = '0xb119b8895801111ff323ba63a77D4Fe78ED057a5'
|
||||
|
||||
// ERC721Factory
|
||||
subgraph = subgraph.replace(
|
||||
/0x0599a4a2873B38D836E10302De1ca4834F7BDF4E/g,
|
||||
ERC721Factory
|
||||
)
|
||||
|
||||
subgraph = subgraph.replace(
|
||||
/0x2356DeCd8CFB6c6f2bf46b5ED4531818B4662337/g,
|
||||
FixedRateExchange
|
||||
)
|
||||
|
||||
subgraph = subgraph.replace(
|
||||
/0xb119b8895801111ff323ba63a77D4Fe78ED057a5/g,
|
||||
Dispenser
|
||||
)
|
||||
|
||||
// network
|
||||
subgraph = subgraph.replace(/network: mainnet/g, 'network: barge')
|
||||
|
||||
// startBlocks
|
||||
subgraph = subgraph.replace(/startBlock:[ 0-9].*/g, 'startBlock: 0')
|
||||
|
||||
fs.writeFileSync('subgraph.barge.yaml', subgraph, 'utf8')
|
||||
} catch (e) {
|
||||
console.error('Failed to load address.json')
|
||||
console.error(e)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
replaceContractAddresses()
|
@ -0,0 +1,47 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
var fs = require('fs')
|
||||
var addresses = require('@oceanprotocol/contracts/addresses/address.json')
|
||||
|
||||
async function replaceContractAddresses() {
|
||||
// load addresses file first
|
||||
if (process.env.ADDRESS_FILE) {
|
||||
console.log('Using custom ADDRESS_FILE instead of ocean-contracts npm dep')
|
||||
addresses = JSON.parse(fs.readFileSync(process.env.ADDRESS_FILE, 'utf8'))
|
||||
}
|
||||
console.log(process.argv)
|
||||
for (const network in addresses) {
|
||||
if (process.argv[2] && process.argv[2] != network) {
|
||||
console.log('Skipping ' + network)
|
||||
continue
|
||||
}
|
||||
console.log('Creating subgraph.' + network + '.yaml')
|
||||
let subgraph = fs.readFileSync('./scripts/subgraph.yaml', 'utf8')
|
||||
|
||||
subgraph = subgraph.replace(/__NETWORK__/g, network)
|
||||
subgraph = subgraph.replace(
|
||||
/__STARTBLOCK__/g,
|
||||
addresses[network].startBlock
|
||||
)
|
||||
subgraph = subgraph.replace(
|
||||
/__ERC721FACTORYADDRESS__/g,
|
||||
"'" + addresses[network].ERC721Factory + "'"
|
||||
)
|
||||
subgraph = subgraph.replace(
|
||||
/__FIXEDRATEEXCHANGEADDRESS__/g,
|
||||
"'" + addresses[network].FixedPrice + "'"
|
||||
)
|
||||
subgraph = subgraph.replace(
|
||||
/__DISPENSERADDRESS__/g,
|
||||
"'" + addresses[network].FixedPrice + "'"
|
||||
)
|
||||
subgraph = subgraph.replace(
|
||||
/__FACTORYROUTERADDRESS__/g,
|
||||
"'" + addresses[network].Router + "'"
|
||||
)
|
||||
if (network != 'development')
|
||||
fs.writeFileSync('subgraph.' + network + '.yaml', subgraph, 'utf8')
|
||||
else fs.writeFileSync('subgraph.yaml', subgraph, 'utf8')
|
||||
}
|
||||
}
|
||||
|
||||
replaceContractAddresses()
|
@ -1,213 +0,0 @@
|
||||
specVersion: 0.0.2
|
||||
description: Ocean provides data sharing through IDOs
|
||||
repository: https://github.com/oceanprotocol/ocean-subgraph
|
||||
schema:
|
||||
file: ./schema.graphql
|
||||
dataSources:
|
||||
- kind: ethereum/contract
|
||||
name: Factory
|
||||
network: bsc
|
||||
source:
|
||||
address: '0xc313e19146Fc9a04470689C9d41a4D3054693531'
|
||||
abi: Factory
|
||||
startBlock: 8114772
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/factory.ts
|
||||
entities:
|
||||
- PoolFactory
|
||||
abis:
|
||||
- name: Factory
|
||||
file: ./abis/BFactory.json
|
||||
eventHandlers:
|
||||
- event: BPoolRegistered(address,indexed address)
|
||||
handler: handleNewPool
|
||||
- kind: ethereum/contract
|
||||
name: DTFactory
|
||||
network: bsc
|
||||
source:
|
||||
address: '0xE9397625Df9B63f0C152f975234b7988b54710B8'
|
||||
abi: DTFactory
|
||||
startBlock: 8114772
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/dtfactory.ts
|
||||
entities:
|
||||
- DatatokenFactory
|
||||
abis:
|
||||
- name: DTFactory
|
||||
file: ./abis/DTFactory.json
|
||||
eventHandlers:
|
||||
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
|
||||
handler: handleNewToken
|
||||
- kind: ethereum/contract
|
||||
name: Metadata
|
||||
network: bsc
|
||||
source:
|
||||
address: '0x1d535147a97bd87c8443125376E6671B60556E07'
|
||||
abi: Metadata
|
||||
startBlock: 8114772
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/metadata.ts
|
||||
entities:
|
||||
- Metadata
|
||||
abis:
|
||||
- name: Metadata
|
||||
file: ./abis/Metadata.json
|
||||
eventHandlers:
|
||||
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
|
||||
handler: handleMetadataCreated
|
||||
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
|
||||
handler: handleMetadataUpdated
|
||||
- kind: ethereum/contract
|
||||
name: FixedRateExchange
|
||||
network: bsc
|
||||
source:
|
||||
address: '0x98679D582AB3398C03D3308dEB9c7AeC50B52ded'
|
||||
abi: FixedRateExchange
|
||||
startBlock: 8114772
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/fixedrateexchange.ts
|
||||
entities:
|
||||
- FixedRateExchange
|
||||
abis:
|
||||
- name: FixedRateExchange
|
||||
file: ./abis/FixedRateExchange.json
|
||||
- name: ERC20
|
||||
file: ./abis/ERC20.json
|
||||
- name: ERC20SymbolBytes
|
||||
file: ./abis/ERC20SymbolBytes.json
|
||||
- name: ERC20NameBytes
|
||||
file: ./abis/ERC20NameBytes.json
|
||||
eventHandlers:
|
||||
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
|
||||
handler: handleExchangeCreated
|
||||
- event: ExchangeActivated(indexed bytes32,indexed address)
|
||||
handler: handleExchangeActivated
|
||||
- event: ExchangeDeactivated(indexed bytes32,indexed address)
|
||||
handler: handleExchangeDeactivated
|
||||
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
|
||||
handler: handleExchangeRateChanged
|
||||
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
|
||||
handler: handleSwapped
|
||||
- kind: ethereum/contract
|
||||
name: Dispenser
|
||||
network: bsc
|
||||
source:
|
||||
address: '0xFe7967A5176fDAFa8DE109b3507016B885a82D6e'
|
||||
abi: Dispenser
|
||||
startBlock: 8114772
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/dispenser.ts
|
||||
entities:
|
||||
- Dispenser
|
||||
abis:
|
||||
- name: Dispenser
|
||||
file: ./abis/Dispenser.json
|
||||
eventHandlers:
|
||||
- event: Activated(indexed address)
|
||||
handler: handleDispenserActivated
|
||||
- event: Deactivated(indexed address)
|
||||
handler: handleDispenserDeactivated
|
||||
- event: AcceptedMinter(indexed address)
|
||||
handler: handleDispenserAcceptedMinter
|
||||
- event: RemovedMinter(indexed address)
|
||||
handler: handleDispenserRemovedMinter
|
||||
- event: TokensDispensed(indexed address,indexed address,uint256)
|
||||
handler: handleDispenserTokensDispensed
|
||||
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
|
||||
handler: handleDispenserOwnerWithdrawed
|
||||
templates:
|
||||
- kind: ethereum/contract
|
||||
name: Pool
|
||||
network: bsc
|
||||
source:
|
||||
abi: Pool
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/pool.ts
|
||||
entities:
|
||||
- Pool
|
||||
- PoolFactory
|
||||
- Swap
|
||||
abis:
|
||||
- name: Pool
|
||||
file: ./abis/BPool.json
|
||||
- name: BToken
|
||||
file: ./abis/BToken.json
|
||||
- name: ERC20
|
||||
file: ./abis/ERC20.json
|
||||
- name: ERC20SymbolBytes
|
||||
file: ./abis/ERC20SymbolBytes.json
|
||||
- name: ERC20NameBytes
|
||||
file: ./abis/ERC20NameBytes.json
|
||||
eventHandlers:
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetSwapFee
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetController
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetPublicSwap
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleFinalize
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetup
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleRebind
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleRebind
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleGulp
|
||||
- event: LOG_JOIN(indexed address,indexed address,uint256)
|
||||
handler: handleJoinPool
|
||||
- event: LOG_EXIT(indexed address,indexed address,uint256)
|
||||
handler: handleExitPool
|
||||
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
|
||||
handler: handleSwap
|
||||
- event: Transfer(indexed address,indexed address,uint256)
|
||||
handler: handleTransfer
|
||||
|
||||
- kind: ethereum/contract
|
||||
name: DataToken
|
||||
network: bsc
|
||||
source:
|
||||
abi: DataToken
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/datatoken.ts
|
||||
entities:
|
||||
- DataToken
|
||||
- DatatokenFactory
|
||||
abis:
|
||||
- name: DataToken
|
||||
file: ./abis/DataTokenTemplate.json
|
||||
eventHandlers:
|
||||
- event: Transfer(indexed address,indexed address,uint256)
|
||||
handler: handleTransfer
|
||||
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
|
||||
handler: handleOrderStarted
|
@ -1,213 +0,0 @@
|
||||
specVersion: 0.0.2
|
||||
description: Ocean provides data sharing through IDOs
|
||||
repository: https://github.com/oceanprotocol/ocean-subgraph
|
||||
schema:
|
||||
file: ./schema.graphql
|
||||
dataSources:
|
||||
- kind: ethereum/contract
|
||||
name: Factory
|
||||
network: catenaxtestnet
|
||||
source:
|
||||
address: '0x3C5605202eD47C162450AE975415473e73F93072'
|
||||
abi: Factory
|
||||
startBlock: 9223
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/factory.ts
|
||||
entities:
|
||||
- PoolFactory
|
||||
abis:
|
||||
- name: Factory
|
||||
file: ./abis/BFactory.json
|
||||
eventHandlers:
|
||||
- event: BPoolRegistered(address,indexed address)
|
||||
handler: handleNewPool
|
||||
- kind: ethereum/contract
|
||||
name: DTFactory
|
||||
network: catenaxtestnet
|
||||
source:
|
||||
address: '0x2112Eb973af1DBf83a4f11eda82f7a7527D7Fde5'
|
||||
abi: DTFactory
|
||||
startBlock: 9221
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/dtfactory.ts
|
||||
entities:
|
||||
- DatatokenFactory
|
||||
abis:
|
||||
- name: DTFactory
|
||||
file: ./abis/DTFactory.json
|
||||
eventHandlers:
|
||||
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
|
||||
handler: handleNewToken
|
||||
- kind: ethereum/contract
|
||||
name: Metadata
|
||||
network: catenaxtestnet
|
||||
source:
|
||||
address: '0xDEfD0018969cd2d4E648209F876ADe184815f038'
|
||||
abi: Metadata
|
||||
startBlock: 9225
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/metadata.ts
|
||||
entities:
|
||||
- Metadata
|
||||
abis:
|
||||
- name: Metadata
|
||||
file: ./abis/Metadata.json
|
||||
eventHandlers:
|
||||
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
|
||||
handler: handleMetadataCreated
|
||||
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
|
||||
handler: handleMetadataUpdated
|
||||
- kind: ethereum/contract
|
||||
name: FixedRateExchange
|
||||
network: catenaxtestnet
|
||||
source:
|
||||
address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD'
|
||||
abi: FixedRateExchange
|
||||
startBlock: 9224
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/fixedrateexchange.ts
|
||||
entities:
|
||||
- FixedRateExchange
|
||||
abis:
|
||||
- name: FixedRateExchange
|
||||
file: ./abis/FixedRateExchange.json
|
||||
- name: ERC20
|
||||
file: ./abis/ERC20.json
|
||||
- name: ERC20SymbolBytes
|
||||
file: ./abis/ERC20SymbolBytes.json
|
||||
- name: ERC20NameBytes
|
||||
file: ./abis/ERC20NameBytes.json
|
||||
eventHandlers:
|
||||
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
|
||||
handler: handleExchangeCreated
|
||||
- event: ExchangeActivated(indexed bytes32,indexed address)
|
||||
handler: handleExchangeActivated
|
||||
- event: ExchangeDeactivated(indexed bytes32,indexed address)
|
||||
handler: handleExchangeDeactivated
|
||||
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
|
||||
handler: handleExchangeRateChanged
|
||||
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
|
||||
handler: handleSwapped
|
||||
- kind: ethereum/contract
|
||||
name: Dispenser
|
||||
network: catenaxtestnet
|
||||
source:
|
||||
address: '0x9C9eE07b8Ce907D2f9244F8317C1Ed29A3193bAe'
|
||||
abi: Dispenser
|
||||
startBlock: 9226
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/dispenser.ts
|
||||
entities:
|
||||
- Dispenser
|
||||
abis:
|
||||
- name: Dispenser
|
||||
file: ./abis/Dispenser.json
|
||||
eventHandlers:
|
||||
- event: Activated(indexed address)
|
||||
handler: handleDispenserActivated
|
||||
- event: Deactivated(indexed address)
|
||||
handler: handleDispenserDeactivated
|
||||
- event: AcceptedMinter(indexed address)
|
||||
handler: handleDispenserAcceptedMinter
|
||||
- event: RemovedMinter(indexed address)
|
||||
handler: handleDispenserRemovedMinter
|
||||
- event: TokensDispensed(indexed address,indexed address,uint256)
|
||||
handler: handleDispenserTokensDispensed
|
||||
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
|
||||
handler: handleDispenserOwnerWithdrawed
|
||||
templates:
|
||||
- kind: ethereum/contract
|
||||
name: Pool
|
||||
network: catenaxtestnet
|
||||
source:
|
||||
abi: Pool
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.5
|
||||
language: wasm/assemblyscript
|
||||
file: ./src/mappings/pool.ts
|
||||
entities:
|
||||
- Pool
|
||||
- PoolFactory
|
||||
- Swap
|
||||
abis:
|
||||
- name: Pool
|
||||
file: ./abis/BPool.json
|
||||
- name: BToken
|
||||
file: ./abis/BToken.json
|
||||
- name: ERC20
|
||||
file: ./abis/ERC20.json
|
||||
- name: ERC20SymbolBytes
|
||||
file: ./abis/ERC20SymbolBytes.json
|
||||
- name: ERC20NameBytes
|
||||
file: ./abis/ERC20NameBytes.json
|
||||
eventHandlers:
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetSwapFee
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetController
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
|
||||
handler: handleSetPublicSwap
|
||||
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
|
||||
topic0: '0x4bb278f3000000000000000000 |