Skip to content

Commit

Permalink
Merge pull request #19 from poanetwork/develop
Browse files Browse the repository at this point in the history
merging changes for erc20-to-native bridge to master
  • Loading branch information
akolotov authored Dec 10, 2018
2 parents 8f0eeb5 + 37a47db commit 021b5c3
Show file tree
Hide file tree
Showing 31 changed files with 6,024 additions and 1,457 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ HOME_RPC_URL=https://sokol.poa.network
FOREIGN_RPC_URL=https://kovan.infura.io/mew
HOME_BRIDGE_ADDRESS=0xABb4C1399DcC28FBa3Beb76CAE2b50Be3e087353
FOREIGN_BRIDGE_ADDRESS=0xE405F6872cE38a7a4Ff63DcF946236D458c2ca3a
POA20_ADDRESS=0x6F794fb14d01f7551C1fe5614FDDf5895A2e82d3
HOME_DEPLOYMENT_BLOCK=0
FOREIGN_DEPLOYMENT_BLOCK=0
GAS_PRICE_SPEED_TYPE=standard
Expand Down
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"plugins": ["node", "prettier"],
"extends": [
"plugin:node/recommended",
"airbnb-base",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": "error",
"arrow-body-style": "off",
"no-await-in-loop": "off",
"no-console": "off",
"no-else-return": "off",
"no-plusplus": "off",
"no-restricted-syntax": "off",
"no-shadow": "off",
"prefer-template": "off"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ responses/*
!responses/.gitkeep
*.err
*.out
.idea
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 100
}
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ https://bridge-monitoring.poa.net/

This tools allows you to spin up node.js server to monitor for 2 contracts on
Home and Foreign Eth networks to check for balance difference.
On Home network it checks for `HOME_BRIDGE_ADDRESS` balance
On Foreign network it checks for `POA20_ADDRESS` total supply.
On Home network it checks for `HOME_BRIDGE_ADDRESS` balance.
On Foreign network it checks for the `ERC20 token` total supply for the `FOREIGN_BRIDGE_ADDRESS`.

Example of an API

Expand All @@ -17,20 +17,17 @@ Example of an API
"home": {
"balance": "3710077.6896438415780044",
"deposits": 481,
"withdrawals": 221,
"requiredSignatures": 2
"withdrawals": 221
},
"foreign": {
"totalSupply": "3710077.6896438415780044",
"deposits": 481,
"withdrawals": 221,
"requiredSignatures": 2
"withdrawals": 221
},
"balanceDiff": 0,
"lastChecked": 1529511982,
"depositsDiff": 0,
"withdrawalDiff": 0,
"requiredSignaturesMatch": true
"withdrawalDiff": 0
}
```

Expand All @@ -54,7 +51,8 @@ Example of an API
"leftTx": 66650466250000,
"gasPrice": 1
}
}
},
"requiredSignatures": 2
},
"foreign": {
"validators": {
Expand All @@ -73,8 +71,11 @@ Example of an API
"leftTx": 28863,
"gasPrice": 2.2
}
}
},
"requiredSignatures": 2
},
"requiredSignaturesMatch": true,
"validatorsMatch": true,
"lastChecked": 1529512164
}
```
Expand Down Expand Up @@ -123,7 +124,6 @@ HOME_RPC_URL=https://sokol.poa.network
FOREIGN_RPC_URL=https://kovan.infura.io/mew
HOME_BRIDGE_ADDRESS=0xABb4C1399DcC28FBa3Beb76CAE2b50Be3e087353
FOREIGN_BRIDGE_ADDRESS=0xE405F6872cE38a7a4Ff63DcF946236D458c2ca3a
POA20_ADDRESS=0x6F794fb14d01f7551C1fe5614FDDf5895A2e82d3
GAS_PRICE_SPEED_TYPE=standard
GAS_LIMIT=300000
GAS_PRICE_FALLBACK=21
Expand Down
61 changes: 57 additions & 4 deletions abis/BridgeValidators.abi.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
[
{
"constant": true,
"inputs": [],
"name": "getBridgeValidatorsInterfacesVersion",
"outputs": [
{
"name": "major",
"type": "uint64"
},
{
"name": "minor",
"type": "uint64"
},
{
"name": "patch",
"type": "uint64"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
Expand Down Expand Up @@ -31,7 +53,7 @@
"anonymous": false,
"inputs": [
{
"indexed": false,
"indexed": true,
"name": "validator",
"type": "address"
}
Expand All @@ -43,14 +65,26 @@
"anonymous": false,
"inputs": [
{
"indexed": false,
"indexed": true,
"name": "validator",
"type": "address"
}
],
"name": "ValidatorRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "requiredSignatures",
"type": "uint256"
}
],
"name": "RequiredSignaturesChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -85,7 +119,12 @@
}
],
"name": "initialize",
"outputs": [],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
Expand Down Expand Up @@ -211,5 +250,19 @@
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "deployedAtBlock",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
]
175 changes: 175 additions & 0 deletions abis/ERC20.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
[
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "who",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "owner",
"type": "address"
},
{
"indexed": true,
"name": "spender",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "from",
"type": "address"
},
{
"indexed": true,
"name": "to",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"constant": true,
"inputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "from",
"type": "address"
},
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "spender",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
Loading

0 comments on commit 021b5c3

Please sign in to comment.