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
db23f70a
Commit
db23f70a
authored
Nov 30, 2020
by
aniket-engg
Committed by
Aniket
Dec 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
txFormat and txHelper
parent
1678b0e9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
txFormat.ts
libs/remix-lib/src/execution/txFormat.ts
+10
-10
txHelper.ts
libs/remix-lib/src/execution/txHelper.ts
+0
-0
No files found.
libs/remix-lib/src/execution/txFormat.ts
View file @
db23f70a
'use strict'
'use strict'
const
ethers
=
require
(
'ethers'
)
import
{
ethers
}
from
'ethers'
const
helper
=
require
(
'./txHelper'
)
const
helper
=
require
(
'./txHelper'
)
const
asyncJS
=
require
(
'async'
)
import
{
eachOfSeries
}
from
'async'
const
solcLinker
=
require
(
'solc/linker'
)
import
{
linkBytecode
}
from
'solc/linker'
const
ethJSUtil
=
require
(
'ethereumjs-util'
)
import
{
isValidAddress
,
addHexPrefix
}
from
'ethereumjs-util'
module
.
exports
=
{
module
.
exports
=
{
...
@@ -38,7 +38,7 @@ module.exports = {
...
@@ -38,7 +38,7 @@ module.exports = {
* @param {Function} callback - callback
* @param {Function} callback - callback
*/
*/
encodeParams
:
function
(
params
,
funAbi
,
callback
)
{
encodeParams
:
function
(
params
,
funAbi
,
callback
)
{
let
data
=
''
let
data
:
any
=
''
let
dataHex
=
''
let
dataHex
=
''
let
funArgs
let
funArgs
if
(
params
.
indexOf
(
'raw:0x'
)
===
0
)
{
if
(
params
.
indexOf
(
'raw:0x'
)
===
0
)
{
...
@@ -104,7 +104,7 @@ module.exports = {
...
@@ -104,7 +104,7 @@ module.exports = {
for
(
let
libFile
in
linkLibraries
)
{
for
(
let
libFile
in
linkLibraries
)
{
for
(
let
lib
in
linkLibraries
[
libFile
])
{
for
(
let
lib
in
linkLibraries
[
libFile
])
{
const
address
=
linkLibraries
[
libFile
][
lib
]
const
address
=
linkLibraries
[
libFile
][
lib
]
if
(
!
ethJSUtil
.
isValidAddress
(
address
))
return
callback
(
address
+
' is not a valid address. Please check the provided address is valid.'
)
if
(
!
isValidAddress
(
address
))
return
callback
(
address
+
' is not a valid address. Please check the provided address is valid.'
)
bytecodeToDeploy
=
this
.
linkLibraryStandardFromlinkReferences
(
lib
,
address
.
replace
(
'0x'
,
''
),
bytecodeToDeploy
,
linkReferences
)
bytecodeToDeploy
=
this
.
linkLibraryStandardFromlinkReferences
(
lib
,
address
.
replace
(
'0x'
,
''
),
bytecodeToDeploy
,
linkReferences
)
}
}
}
}
...
@@ -168,7 +168,7 @@ module.exports = {
...
@@ -168,7 +168,7 @@ module.exports = {
*/
*/
buildData
:
function
(
contractName
,
contract
,
contracts
,
isConstructor
,
funAbi
,
params
,
callback
,
callbackStep
,
callbackDeployLibrary
)
{
buildData
:
function
(
contractName
,
contract
,
contracts
,
isConstructor
,
funAbi
,
params
,
callback
,
callbackStep
,
callbackDeployLibrary
)
{
let
funArgs
=
[]
let
funArgs
=
[]
let
data
=
''
let
data
:
any
=
''
let
dataHex
=
''
let
dataHex
=
''
if
(
params
.
indexOf
(
'raw:0x'
)
===
0
)
{
if
(
params
.
indexOf
(
'raw:0x'
)
===
0
)
{
...
@@ -223,8 +223,8 @@ module.exports = {
...
@@ -223,8 +223,8 @@ module.exports = {
linkBytecodeStandard
:
function
(
contract
,
contracts
,
callback
,
callbackStep
,
callbackDeployLibrary
)
{
linkBytecodeStandard
:
function
(
contract
,
contracts
,
callback
,
callbackStep
,
callbackDeployLibrary
)
{
let
contractBytecode
=
contract
.
evm
.
bytecode
.
object
let
contractBytecode
=
contract
.
evm
.
bytecode
.
object
asyncJS
.
eachOfSeries
(
contract
.
evm
.
bytecode
.
linkReferences
,
(
libs
,
file
,
cbFile
)
=>
{
eachOfSeries
(
contract
.
evm
.
bytecode
.
linkReferences
,
(
libs
,
file
,
cbFile
)
=>
{
asyncJS
.
eachOfSeries
(
contract
.
evm
.
bytecode
.
linkReferences
[
file
],
(
libRef
,
libName
,
cbLibDeployed
)
=>
{
eachOfSeries
(
contract
.
evm
.
bytecode
.
linkReferences
[
file
],
(
libRef
,
libName
,
cbLibDeployed
)
=>
{
const
library
=
contracts
[
file
][
libName
]
const
library
=
contracts
[
file
][
libName
]
if
(
library
)
{
if
(
library
)
{
this
.
deployLibrary
(
file
+
':'
+
libName
,
libName
,
library
,
contracts
,
(
error
,
address
)
=>
{
this
.
deployLibrary
(
file
+
':'
+
libName
,
libName
,
library
,
contracts
,
(
error
,
address
)
=>
{
...
@@ -351,7 +351,7 @@ module.exports = {
...
@@ -351,7 +351,7 @@ module.exports = {
},
},
linkLibrary
:
function
(
libraryName
,
address
,
bytecodeToLink
)
{
linkLibrary
:
function
(
libraryName
,
address
,
bytecodeToLink
)
{
return
solcLinker
.
linkBytecode
(
bytecodeToLink
,
{
[
libraryName
]:
ethJSUtil
.
addHexPrefix
(
address
)
})
return
linkBytecode
(
bytecodeToLink
,
{
[
libraryName
]:
addHexPrefix
(
address
)
})
},
},
decodeResponse
:
function
(
response
,
fnabi
)
{
decodeResponse
:
function
(
response
,
fnabi
)
{
...
...
libs/remix-lib/src/execution/txHelper.ts
View file @
db23f70a
This diff is collapsed.
Click to expand it.
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