From aa9c3104365f2d023b0ae3788a050d502a492a7e Mon Sep 17 00:00:00 2001 From: Deric Walintukan Date: Mon, 3 Jun 2019 17:14:46 +0700 Subject: [PATCH 1/3] Update metadata --- src/config/contracts/event-factory.js | 7 +++++++ src/config/contracts/multiple-results-event.js | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/config/contracts/event-factory.js b/src/config/contracts/event-factory.js index d604d956..31612128 100644 --- a/src/config/contracts/event-factory.js +++ b/src/config/contracts/event-factory.js @@ -5,6 +5,13 @@ * been synced. */ module.exports = { + 4: { + mainnet: '', + mainnetDeployBlock: 0, + testnet: '0x45c537f157986dfaa7026af3f055bba77b970fc8', + testnetDeployBlock: 3735500, + abi: [{"inputs": [{"name": "configManager","type": "address"}],"payable": false,"stateMutability": "nonpayable","type": "constructor"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "ownerAddress","type": "address"}],"name": "MultipleResultsEventCreated","type": "event"},{"constant": false,"inputs": [{"name": "from","type": "address"},{"name": "value","type": "uint256"},{"name": "data","type": "bytes"}],"name": "tokenFallback","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": false,"inputs": [],"name": "withdrawEscrow","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": true,"inputs": [],"name": "didWithdraw","outputs": [{"name": "","type": "bool"}],"payable": false,"stateMutability": "view","type": "function"}], + }, 3: { mainnet: '', mainnetDeployBlock: 0, diff --git a/src/config/contracts/multiple-results-event.js b/src/config/contracts/multiple-results-event.js index 1d0a0082..0cac1054 100644 --- a/src/config/contracts/multiple-results-event.js +++ b/src/config/contracts/multiple-results-event.js @@ -3,6 +3,9 @@ * Use the contract version number as the object key. */ module.exports = { + 4: { + abi: [{"constant": true,"inputs": [],"name": "owner","outputs": [{"name": "","type": "address"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": false,"inputs": [{"name": "_newOwner","type": "address"}],"name": "transferOwnership","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"inputs": [{"name": "owner","type": "address"},{"name": "eventName","type": "string"},{"name": "eventResults","type": "bytes32[4]"},{"name": "numOfResults","type": "uint8"},{"name": "betStartTime","type": "uint256"},{"name": "betEndTime","type": "uint256"},{"name": "resultSetStartTime","type": "uint256"},{"name": "resultSetEndTime","type": "uint256"},{"name": "centralizedOracle","type": "address"},{"name": "arbitrationOptionIndex","type": "uint8"},{"name": "arbitrationRewardPercentage","type": "uint256"},{"name": "configManager","type": "address"}],"payable": false,"stateMutability": "nonpayable","type": "constructor"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "better","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"}],"name": "BetPlaced","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "centralizedOracle","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"},{"indexed": false,"name": "nextConsensusThreshold","type": "uint256"},{"indexed": false,"name": "nextArbitrationEndTime","type": "uint256"}],"name": "ResultSet","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "voter","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"}],"name": "VotePlaced","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "voter","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"},{"indexed": false,"name": "nextConsensusThreshold","type": "uint256"},{"indexed": false,"name": "nextArbitrationEndTime","type": "uint256"}],"name": "VoteResultSet","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "winner","type": "address"},{"indexed": false,"name": "winningAmount","type": "uint256"},{"indexed": false,"name": "escrowAmount","type": "uint256"}],"name": "WinningsWithdrawn","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "_previousOwner","type": "address"},{"indexed": true,"name": "_newOwner","type": "address"}],"name": "OwnershipTransferred","type": "event"},{"constant": false,"inputs": [{"name": "from","type": "address"},{"name": "value","type": "uint256"},{"name": "data","type": "bytes"}],"name": "tokenFallback","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": false,"inputs": [],"name": "withdraw","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": true,"inputs": [{"name": "player","type": "address"}],"name": "calculateWinnings","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "version","outputs": [{"name": "","type": "uint16"}],"payable": false,"stateMutability": "pure","type": "function"},{"constant": true,"inputs": [],"name": "currentRound","outputs": [{"name": "","type": "uint8"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "currentResultIndex","outputs": [{"name": "","type": "uint8"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "currentConsensusThreshold","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "currentArbitrationEndTime","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "eventMetadata","outputs": [{"name": "","type": "uint16"},{"name": "","type": "string"},{"name": "","type": "bytes32[4]"},{"name": "","type": "uint8"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "centralizedMetadata","outputs": [{"name": "","type": "address"},{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "configMetadata","outputs": [{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "totalBets","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [{"name": "withdrawer","type": "address"}],"name": "didWithdraw","outputs": [{"name": "","type": "bool"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "didWithdrawEscrow","outputs": [{"name": "","type": "bool"}],"payable": false,"stateMutability": "view","type": "function"}], + }, 3: { abi: [{"constant": true,"inputs": [],"name": "owner","outputs": [{"name": "","type": "address"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": false,"inputs": [{"name": "_newOwner","type": "address"}],"name": "transferOwnership","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"inputs": [{"name": "owner","type": "address"},{"name": "eventName","type": "string"},{"name": "eventResults","type": "bytes32[4]"},{"name": "numOfResults","type": "uint8"},{"name": "betStartTime","type": "uint256"},{"name": "betEndTime","type": "uint256"},{"name": "resultSetStartTime","type": "uint256"},{"name": "resultSetEndTime","type": "uint256"},{"name": "centralizedOracle","type": "address"},{"name": "arbitrationOptionIndex","type": "uint8"},{"name": "arbitrationRewardPercentage","type": "uint256"},{"name": "configManager","type": "address"}],"payable": false,"stateMutability": "nonpayable","type": "constructor"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "better","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"}],"name": "BetPlaced","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "centralizedOracle","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"},{"indexed": false,"name": "nextConsensusThreshold","type": "uint256"},{"indexed": false,"name": "nextArbitrationEndTime","type": "uint256"}],"name": "ResultSet","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "voter","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"}],"name": "VotePlaced","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "voter","type": "address"},{"indexed": false,"name": "resultIndex","type": "uint8"},{"indexed": false,"name": "amount","type": "uint256"},{"indexed": false,"name": "eventRound","type": "uint8"},{"indexed": false,"name": "nextConsensusThreshold","type": "uint256"},{"indexed": false,"name": "nextArbitrationEndTime","type": "uint256"}],"name": "VoteResultSet","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "eventAddress","type": "address"},{"indexed": true,"name": "winner","type": "address"},{"indexed": false,"name": "winningAmount","type": "uint256"},{"indexed": false,"name": "escrowAmount","type": "uint256"}],"name": "WinningsWithdrawn","type": "event"},{"anonymous": false,"inputs": [{"indexed": true,"name": "_previousOwner","type": "address"},{"indexed": true,"name": "_newOwner","type": "address"}],"name": "OwnershipTransferred","type": "event"},{"constant": false,"inputs": [{"name": "from","type": "address"},{"name": "value","type": "uint256"},{"name": "data","type": "bytes"}],"name": "tokenFallback","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": false,"inputs": [],"name": "withdraw","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": true,"inputs": [{"name": "better","type": "address"}],"name": "calculateWinnings","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "version","outputs": [{"name": "","type": "uint16"}],"payable": false,"stateMutability": "pure","type": "function"},{"constant": true,"inputs": [],"name": "currentRound","outputs": [{"name": "","type": "uint8"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "currentResultIndex","outputs": [{"name": "","type": "uint8"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "currentConsensusThreshold","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "currentArbitrationEndTime","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "eventMetadata","outputs": [{"name": "","type": "uint16"},{"name": "","type": "string"},{"name": "","type": "bytes32[4]"},{"name": "","type": "uint8"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "centralizedMetadata","outputs": [{"name": "","type": "address"},{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "configMetadata","outputs": [{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"},{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "totalBets","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [{"name": "withdrawer","type": "address"}],"name": "didWithdraw","outputs": [{"name": "","type": "bool"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [],"name": "didWithdrawEscrow","outputs": [{"name": "","type": "bool"}],"payable": false,"stateMutability": "view","type": "function"}], }, From 6d6a680fe8f5778767de73043e0cf938cdfbb9f7 Mon Sep 17 00:00:00 2001 From: Deric Walintukan Date: Mon, 3 Jun 2019 17:15:30 +0700 Subject: [PATCH 2/3] Change package version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7578571a..0a3089a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bodhi-server", - "version": "3.0.1", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 93528141..d6aeae16 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Server that parses, stores, sends, and receives Bodhi-related data from the blockchain.", "author": "bodhi.network", "license": "LGPL-3.0", - "version": "3.0.1", + "version": "4.0.0", "repository": "git@github.com:bodhiproject/bodhi-server.git", "keywords": [ "bodhi", From ac194b4c2a1c4dcf279dfc123dd8b03c7d3fea6d Mon Sep 17 00:00:00 2001 From: Deric Walintukan Date: Mon, 3 Jun 2019 17:15:46 +0700 Subject: [PATCH 3/3] Change starting event factory version --- src/sync/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sync/index.js b/src/sync/index.js index 79d168e2..6af41122 100644 --- a/src/sync/index.js +++ b/src/sync/index.js @@ -92,7 +92,7 @@ const getStartBlock = async () => { start = blocks[0].blockNum + 1; } else { // No blocks found in DB, use earliest version's deploy block - const contractMeta = eventFactoryMeta(3); + const contractMeta = eventFactoryMeta(4); start = isMainnet() ? contractMeta.mainnetDeployBlock : contractMeta.testnetDeployBlock;