-
Notifications
You must be signed in to change notification settings - Fork 68
IdentityManager - Identity factory with multiple devices and singleton controller support #17
Changes from 1 commit
5dfc653
32380cd
f4ec8d6
048611e
4a6da21
d289ce1
9d4fb31
b5f1771
09ab55c
875ed99
ce9ae06
03a40ff
03a546d
9f8767e
61097de
eca4abc
3ef76aa
e581692
fd749c0
4f84f01
5346800
e2e6420
b266633
8b4d35a
91fb8bf
5dd749a
e8cc4e0
44a7778
d3dab73
200c794
f762602
2f96523
4bbf91e
0c5d59b
e528dd3
f5ff249
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ contract IdentityManager { | |
// Factory function | ||
// gas 289,311 | ||
function CreateIdentity(address owner, address recoveryKey) { | ||
if (recoveryKey == address(0)) throw; | ||
Proxy identity = new Proxy(); | ||
owners[identity][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one | ||
recoveryKeys[identity] = recoveryKey; | ||
|
@@ -92,6 +93,7 @@ contract IdentityManager { | |
// An identity Proxy can use this to register itself with the IdentityManager | ||
// Note they also have to change the owner of the Proxy over to this, but after calling this | ||
function registerIdentity(address owner, address recoveryKey) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oed @christianlundkvist this is what I wrote to do the transfer. Isn't this what you meant? We would still have to do the actual transfer of the proxy as a second transaction. But that would just use forwardTo I thought. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The transfer of the ownership of the proxy needs to use a special function in the proxy contract:
so no way to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @christianlundkvist You mean for transfering an proxy away from the IdentityManager? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But yes, we need a function to transfer the identity away from the IdentityManager There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok I'll have a look @christianlundkvist There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oed Yep what I meant was we need a function in the IdentityManager to transfer a proxy to another IdentityManager. |
||
if (recoveryKey == address(0)) throw; | ||
if (owners[msg.sender][owner] > 0 || recoveryKeys[msg.sender] > 0 ) throw; // Deny any funny business | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First check here is not needed. As we enforce the recoveryKey invariant, this is not an issue. |
||
owners[msg.sender][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one | ||
recoveryKeys[msg.sender] = recoveryKey; | ||
|
@@ -124,6 +126,7 @@ contract IdentityManager { | |
|
||
// an owner can add change the recoverykey whenever they want to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "add change the recoverykey" -> "add or change the recoverykey" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "add change the recoverykey" -> "add or change the recoverykey" |
||
function changeRecovery(Proxy identity, address recoveryKey) onlyOlderOwner(identity) rateLimited(identity) { | ||
if (recoveryKey == address(0)) throw; | ||
recoveryKeys[identity] = recoveryKey; | ||
RecoveryChanged(identity, recoveryKey, msg.sender); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about this
address(0)
. Nice.