Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
俞永鹏
openzeppelin-contracts-upgradeable
Commits
7f723837
Commit
7f723837
authored
Mar 31, 2017
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change type of owners from uint[] to address[]
fixes #175
parent
bc0f9b0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Shareable.sol
contracts/ownership/Shareable.sol
+10
-10
No files found.
contracts/ownership/Shareable.sol
View file @
7f723837
...
...
@@ -23,9 +23,9 @@ contract Shareable {
uint public required;
// list of owners
uint
[256] owners;
address
[256] owners;
// index on the list of owners to allow reverse lookup
mapping(
uint
=> uint) ownerIndex;
mapping(
address
=> uint) ownerIndex;
// the ongoing operations.
mapping(bytes32 => PendingState) pendings;
bytes32[] pendingsIndex;
...
...
@@ -57,18 +57,18 @@ contract Shareable {
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
// as well as the selection of addresses capable of confirming them.
function Shareable(address[] _owners, uint _required) {
owners[1] =
uint(msg.sender)
;
ownerIndex[
uint(msg.sender)
] = 1;
owners[1] =
msg.sender
;
ownerIndex[
msg.sender
] = 1;
for (uint i = 0; i < _owners.length; ++i) {
owners[2 + i] =
uint(_owners[i])
;
ownerIndex[
uint(_owners[i])
] = 2 + i;
owners[2 + i] =
_owners[i]
;
ownerIndex[
_owners[i]
] = 2 + i;
}
required = _required;
}
// Revokes a prior confirmation of the given operation
function revoke(bytes32 _operation) external {
uint index = ownerIndex[
uint(msg.sender)
];
uint index = ownerIndex[
msg.sender
];
// make sure they're an owner
if (index == 0) {
return;
...
...
@@ -88,12 +88,12 @@ contract Shareable {
}
function isOwner(address _addr) constant returns (bool) {
return ownerIndex[
uint(_addr)
] > 0;
return ownerIndex[
_addr
] > 0;
}
function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) {
var pending = pendings[_operation];
uint index = ownerIndex[
uint(_owner)
];
uint index = ownerIndex[
_owner
];
// make sure they're an owner
if (index == 0) {
...
...
@@ -107,7 +107,7 @@ contract Shareable {
function confirmAndCheck(bytes32 _operation) internal returns (bool) {
// determine what index the present sender is:
uint index = ownerIndex[
uint(msg.sender)
];
uint index = ownerIndex[
msg.sender
];
// make sure they're an owner
if (index == 0) {
return;
...
...
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