Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
7386aa10
Commit
7386aa10
authored
Sep 10, 2020
by
袁兴强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common header file for cpp contracts
parent
4e9550f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
common.h
plugin/dapp/wasm/contracts/common.h
+53
-0
No files found.
plugin/dapp/wasm/contracts/common.h
0 → 100644
View file @
7386aa10
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stddef.h>
#include <stdint.h>
void
setStateDB
(
const
char
*
key
,
size_t
k_len
,
const
char
*
value
,
size_t
v_len
);
size_t
getStateDBSize
(
const
char
*
key
,
size_t
k_len
);
size_t
getStateDB
(
const
char
*
key
,
size_t
k_len
,
char
*
value
,
size_t
v_len
);
void
setLocalDB
(
const
char
*
key
,
size_t
k_len
,
const
char
*
value
,
size_t
v_len
);
size_t
getLocalDBSize
(
const
char
*
key
,
size_t
k_len
);
size_t
getLocalDB
(
const
char
*
key
,
size_t
k_len
,
char
*
value
,
size_t
v_len
);
int64_t
getBalance
(
const
char
*
addr
,
size_t
addr_len
,
const
char
*
exec_addr
,
size_t
exec_len
);
int64_t
getFronzen
(
const
char
*
addr
,
size_t
addr_len
,
const
char
*
exec_addr
,
size_t
exec_len
);
void
execAddress
(
const
char
*
name
,
size_t
name_len
,
const
char
*
addr
,
size_t
addr_len
);
int
transfer
(
const
char
*
from_addr
,
size_t
from_len
,
const
char
*
to_addr
,
size_t
to_len
,
int64_t
amount
);
int
transferToExec
(
const
char
*
from_addr
,
size_t
from_len
,
const
char
*
exec_addr
,
size_t
exec_len
,
int64_t
amount
);
int
transferWithdraw
(
const
char
*
from_addr
,
size_t
from_len
,
const
char
*
exec_addr
,
size_t
exec_len
,
int64_t
amount
);
int
execFrozen
(
const
char
*
addr
,
size_t
addr_len
,
int64_t
amount
);
int
execActive
(
const
char
*
addr
,
size_t
addr_len
,
int64_t
amount
);
int
execTransfer
(
const
char
*
from_addr
,
size_t
from_len
,
const
char
*
to_addr
,
size_t
to_len
,
int64_t
amount
);
int
execTransferFrozen
(
const
char
*
from_addr
,
size_t
from_len
,
const
char
*
to_addr
,
size_t
to_len
,
int64_t
amount
);
void
getFrom
(
const
char
*
from_addr
,
size_t
from_len
);
int64_t
getHeight
();
int64_t
getRandom
();
void
sha256
(
const
char
*
data
,
size_t
data_len
,
char
*
sum
,
size_t
sum_len
);
void
printlog
(
const
char
*
log
,
size_t
len
);
void
printint
(
int64_t
n
);
#ifdef __cplusplus
}
#endif
inline
size_t
string_size
(
const
char
*
s
)
{
size_t
l
=
0
;
for
(
const
char
*
tmp
=
s
;
*
tmp
!=
'\0'
;
tmp
++
)
{
l
++
;
}
return
l
;
}
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