Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
63faa057
Unverified
Commit
63faa057
authored
8 years ago
by
Benjamin Bollen
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/release-0.16' into release-0.16-remove-tendermint-common
parents
bb216103
33ce2a93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
manager/eris-mint/evm/snative.go
+17
-11
17 additions, 11 deletions
manager/eris-mint/evm/snative.go
with
17 additions
and
11 deletions
manager/eris-mint/evm/snative.go
+
17
−
11
View file @
63faa057
...
...
@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/eris-ltd/eris-db/common/sanity"
"github.com/eris-ltd/eris-db/manager/eris-mint/evm/sha3"
ptypes
"github.com/eris-ltd/eris-db/permission/types"
.
"github.com/eris-ltd/eris-db/word256"
)
...
...
@@ -42,10 +43,10 @@ type SNativeFuncDescription struct {
/* The solidity interface used to generate the abi function ids below
contract Permissions {
function has_base(address addr, int permFlag) constant returns (bool value) {}
function set_base(address addr, int permFlag, bool value) constant returns (bool val) {}
function unset_base(address addr, int permFlag) constant returns (int pf) {}
function set_global(
address addr,
int permFlag, bool value) constant returns (int pf) {}
function has_base(address addr,
u
int
64
permFlag) constant returns (bool value) {}
function set_base(address addr,
u
int
64
permFlag, bool value) constant returns (bool val) {}
function unset_base(address addr,
u
int
64
permFlag) constant returns (
u
int
64
pf) {}
function set_global(
u
int
64
permFlag, bool value) constant returns (
u
int
64
pf) {}
function has_role(address addr, string role) constant returns (bool val) {}
function add_role(address addr, string role) constant returns (bool added) {}
function rm_role(address addr, string role) constant returns (bool removed) {}
...
...
@@ -54,13 +55,18 @@ contract Permissions {
// function identifiers from the solidity abi
var
PermsMap
=
map
[
string
]
SNativeFuncDescription
{
"e8145855"
:
SNativeFuncDescription
{
"has_role"
,
2
,
ptypes
.
HasRole
,
has_role
},
"180d26f2"
:
SNativeFuncDescription
{
"unset_base"
,
2
,
ptypes
.
UnsetBase
,
unset_base
},
"3a3fcc59"
:
SNativeFuncDescription
{
"set_global"
,
2
,
ptypes
.
SetGlobal
,
set_global
},
"3fbf7da5"
:
SNativeFuncDescription
{
"add_role"
,
2
,
ptypes
.
AddRole
,
add_role
},
"9ea53314"
:
SNativeFuncDescription
{
"set_base"
,
3
,
ptypes
.
SetBase
,
set_base
},
"bb37737a"
:
SNativeFuncDescription
{
"has_base"
,
2
,
ptypes
.
HasBase
,
has_base
},
"28fd0194"
:
SNativeFuncDescription
{
"rm_role"
,
2
,
ptypes
.
RmRole
,
rm_role
},
getFuncIdentifiersFromSignature
(
"has_role(address,bytes32)"
)
:
SNativeFuncDescription
{
"has_role"
,
2
,
ptypes
.
HasRole
,
has_role
},
getFuncIdentifiersFromSignature
(
"unset_base(address,uint64)"
)
:
SNativeFuncDescription
{
"unset_base"
,
2
,
ptypes
.
UnsetBase
,
unset_base
},
getFuncIdentifiersFromSignature
(
"set_global(uint64,bool)"
)
:
SNativeFuncDescription
{
"set_global"
,
2
,
ptypes
.
SetGlobal
,
set_global
},
getFuncIdentifiersFromSignature
(
"add_role(address,bytes32)"
)
:
SNativeFuncDescription
{
"add_role"
,
2
,
ptypes
.
AddRole
,
add_role
},
getFuncIdentifiersFromSignature
(
"set_base(address,uint64,bool"
)
:
SNativeFuncDescription
{
"set_base"
,
3
,
ptypes
.
SetBase
,
set_base
},
getFuncIdentifiersFromSignature
(
"has_base(address,uint64)"
)
:
SNativeFuncDescription
{
"has_base"
,
2
,
ptypes
.
HasBase
,
has_base
},
getFuncIdentifiersFromSignature
(
"rm_role(address,bytes32)"
)
:
SNativeFuncDescription
{
"rm_role"
,
2
,
ptypes
.
RmRole
,
rm_role
},
}
func
getFuncIdentifiersFromSignature
(
signature
string
)
string
{
identifier
:=
sha3
.
Sha3
([]
byte
(
signature
))
return
hex
.
EncodeToString
(
identifier
[
:
4
])
}
func
permissionsContract
(
appState
AppState
,
caller
*
Account
,
args
[]
byte
,
gas
*
int64
)
(
output
[]
byte
,
err
error
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment