FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SmartPool.github.io/javascripts/smartpool.js at master · SmartPool/SmartPool.github.io · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SmartPool
/
SmartPool.github.io
Public
Notifications
You must be signed in to change notification settings
Fork
6
Star
5
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SmartPool.github.io
/
javascripts
/
smartpool.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (26 loc) · 1.03 KB
Breadcrumbs
SmartPool.github.io
/
javascripts
/
smartpool.js
Copy path
File metadata and controls
27 lines (26 loc) · 1.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var
Web3
=
require
(
'web3'
)
;
var
publicNode
=
$
.
trim
(
$
(
'#public-node'
)
.
text
(
)
)
;
var
web3
=
new
Web3
(
new
Web3
.
providers
.
HttpProvider
(
publicNode
)
)
;
var
version
=
web3
.
version
.
api
;
var
smartPoolAddress
=
$
.
trim
(
$
(
'#smart-pool-address'
)
.
text
(
)
)
;
var
smartPoolURL
=
$
.
trim
(
$
(
'#smart-pool-abi-url'
)
.
text
(
)
)
;
$
.
getJSON
(
smartPoolURL
,
function
(
data
)
{
var
contractABI
=
""
;
contractABI
=
JSON
.
parse
(
data
.
result
)
;
if
(
contractABI
!=
''
)
{
var
smartPoolContract
=
web3
.
eth
.
contract
(
contractABI
)
;
var
smartPoolInstance
=
smartPoolContract
.
at
(
smartPoolAddress
)
;
var
updateTotalFund
=
function
(
contract
)
{
var
totalFundRaisedInWei
=
contract
.
totalFundRaised
(
)
;
var
totalFundRaised
=
web3
.
fromWei
(
totalFundRaisedInWei
,
"ether"
)
;
$
(
'#total-fund-raised'
)
.
text
(
totalFundRaised
)
;
$
(
'#ether'
)
.
removeClass
(
'hide'
)
;
}
;
updateTotalFund
(
smartPoolInstance
)
;
setInterval
(
function
(
)
{
updateTotalFund
(
smartPoolInstance
)
;
}
,
30000
)
;
}
else
{
console
.
log
(
"We couldn't get information from Etherscan!"
)
;
}
}
)
;
Back
|
FazBrowse Home
|
New Git URL