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
b82177ea
Commit
b82177ea
authored
Jul 22, 2015
by
Alexandre Van de Sande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added geth deploy instructions
parent
69c84cb9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
index.html
index.html
+41
-0
styles.css
stylesheets/styles.css
+1
-1
No files found.
index.html
View file @
b82177ea
...
@@ -59,6 +59,11 @@ body {
...
@@ -59,6 +59,11 @@ body {
.col2
{
.col2
{
width
:
60ex
;
width
:
60ex
;
}
}
textarea
.col2
{
height
:
100px
;
background
:
#fff6dd
;
border-color
:
#efece2
;
}
.runButton
{
.runButton
{
width
:
30ex
;
width
:
30ex
;
text-align
:
left
;
text-align
:
left
;
...
@@ -208,6 +213,36 @@ var detailsOpen = {};
...
@@ -208,6 +213,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
)
{
...
@@ -219,6 +254,7 @@ var renderContracts = function(data, source) {
...
@@ -219,6 +254,7 @@ var renderContracts = function(data, source) {
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
textRow
(
'Deploy Instructions'
,
gethDeploy
(
contractName
,
contract
[
'interface'
],
contract
.
bytecode
)))
.
append
(
getDetails
(
contract
,
source
,
contractName
));
.
append
(
getDetails
(
contract
,
source
,
contractName
));
$
(
'#output'
).
append
(
contractOutput
);
$
(
'#output'
).
append
(
contractOutput
);
}
}
...
@@ -228,6 +264,11 @@ var tableRow = function(description, data) {
...
@@ -228,6 +264,11 @@ 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
(
$
(
'<span class="col1">'
).
text
(
description
))
.
append
(
$
(
'<textarea readonly="readonly" 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;"/>'
)
...
...
stylesheets/styles.css
View file @
b82177ea
@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