Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
2f011483
Commit
2f011483
authored
Jul 22, 2015
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from alexvandesande/gh-pages
added geth deploy instructions
parents
c15abfce
f8e92eff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
index.html
index.html
+47
-1
styles.css
stylesheets/styles.css
+1
-1
No files found.
index.html
View file @
2f011483
...
@@ -56,9 +56,19 @@ body {
...
@@ -56,9 +56,19 @@ body {
width
:
18ex
;
width
:
18ex
;
display
:
inline-block
;
display
:
inline-block
;
}
}
strong
.col1
{
top
:
-10px
;
position
:
relative
;
margin-bottom
:
5px
;
}
.col2
{
.col2
{
width
:
60ex
;
width
:
60ex
;
}
}
textarea
.col2
{
height
:
20px
;
border-color
:
#bebebe
;
margin-bottom
:
5px
;
}
.runButton
{
.runButton
{
width
:
30ex
;
width
:
30ex
;
text-align
:
left
;
text-align
:
left
;
...
@@ -199,6 +209,36 @@ var detailsOpen = {};
...
@@ -199,6 +209,36 @@ var detailsOpen = {};
var
renderError
=
function
(
message
)
{
var
renderError
=
function
(
message
)
{
$
(
'#output'
).
empty
().
append
(
$
(
'<pre></pre>'
).
text
(
message
));
$
(
'#output'
).
empty
().
append
(
$
(
'<pre></pre>'
).
text
(
message
));
};
};
var
gethDeploy
=
function
(
contractName
,
interface
,
bytecode
){
var
code
=
""
;
var
funABI
=
getConstructorInterface
(
$
.
parseJSON
(
interface
));
$
.
each
(
funABI
.
inputs
,
function
(
i
,
inp
)
{
code
+=
"var "
+
inp
.
name
+
" = /* var of type "
+
inp
.
type
+
" here */ ;
\
n"
;
});
code
+=
"
\
nvar "
+
contractName
+
"Contract = web3.eth.contract("
+
interface
.
replace
(
"
\
n"
,
""
)
+
");"
+
"
\
nvar "
+
contractName
+
" = "
+
contractName
+
"Contract.new("
;
$
.
each
(
funABI
.
inputs
,
function
(
i
,
inp
)
{
code
+=
"
\
n "
+
inp
.
name
+
","
;
});
code
+=
"
\
n {"
+
"
\
n from: web3.eth.accounts[0], "
+
"
\
n data: '"
+
bytecode
+
"', "
+
"
\
n gas: 1000000"
+
"
\
n }, function(e, contract){"
+
"
\
n if (typeof contract.address != 'undefined') {"
+
"
\
n console.log(e, contract);"
+
"
\
n console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);"
+
"
\
n }})"
;
return
code
;
}
var
renderContracts
=
function
(
data
,
source
)
{
var
renderContracts
=
function
(
data
,
source
)
{
$
(
'#output'
).
empty
();
$
(
'#output'
).
empty
();
for
(
var
contractName
in
data
.
contracts
)
{
for
(
var
contractName
in
data
.
contracts
)
{
...
@@ -209,7 +249,7 @@ var renderContracts = function(data, source) {
...
@@ -209,7 +249,7 @@ var renderContracts = function(data, source) {
.
append
(
$
(
'<div/>'
).
text
((
contract
.
bytecode
.
length
/
2
)
+
' bytes'
))
.
append
(
$
(
'<div/>'
).
text
((
contract
.
bytecode
.
length
/
2
)
+
' bytes'
))
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
t
ableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
t
extRow
(
'Geth deploy'
,
gethDeploy
(
contractName
.
toLowerCase
(),
contract
[
'interface'
],
contract
.
bytecode
)
))
.
append
(
getDetails
(
contract
,
source
,
contractName
));
.
append
(
getDetails
(
contract
,
source
,
contractName
));
$
(
'#output'
).
append
(
contractOutput
);
$
(
'#output'
).
append
(
contractOutput
);
}
}
...
@@ -219,9 +259,15 @@ var tableRow = function(description, data) {
...
@@ -219,9 +259,15 @@ var tableRow = function(description, data) {
.
append
(
$
(
'<span class="col1">'
).
text
(
description
))
.
append
(
$
(
'<span class="col1">'
).
text
(
description
))
.
append
(
$
(
'<input readonly="readonly" class="col2">'
).
val
(
data
));
.
append
(
$
(
'<input readonly="readonly" class="col2">'
).
val
(
data
));
};
};
var
textRow
=
function
(
description
,
data
)
{
return
$
(
'<div/>'
)
.
append
(
$
(
'<strong class="col1">'
).
text
(
description
))
.
append
(
$
(
'<textarea class="col2" onclick="this.select()">'
+
data
+
"</textarea>"
));
};
var
getDetails
=
function
(
contract
,
source
,
contractName
)
{
var
getDetails
=
function
(
contract
,
source
,
contractName
)
{
var
button
=
$
(
'<button>Details</button>'
);
var
button
=
$
(
'<button>Details</button>'
);
var
details
=
$
(
'<div style="display: none;"/>'
)
var
details
=
$
(
'<div style="display: none;"/>'
)
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
var
funHashes
=
''
;
var
funHashes
=
''
;
for
(
var
fun
in
contract
.
functionHashes
)
for
(
var
fun
in
contract
.
functionHashes
)
...
...
stylesheets/styles.css
View file @
2f011483
@import
url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700)
;
/*@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);*/
body
{
body
{
padding
:
50px
;
padding
:
50px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment