-
Notifications
You must be signed in to change notification settings - Fork 46
Conversation
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.
👍 Solid test coverage as well
bytes32 public recoveryHash; | ||
bytes32 pendingRecoveryHash; | ||
uint256 pendingRecoveryHashTime; | ||
bytes public approvedProxyAdminFunction; | ||
bytes pendingPAFunction; | ||
uint256 pendingPAFunctionTime; | ||
|
||
// BLS variables | ||
uint256[4] public blsPublicKey; | ||
uint256[4] pendingBLSPublicKey; | ||
uint256 pendingBLSPublicKeyTime; | ||
address public trustedBLSGateway; | ||
address pendingBLSGateway; | ||
uint256 pendingGatewayTime; | ||
|
||
event PendingRecoveryHashSet( | ||
bytes32 pendingRecoveryHash | ||
); | ||
event PendingBLSKeySet( | ||
uint256[4] pendingBLSKey | ||
); | ||
event PendingGatewaySet( | ||
address pendingGateway | ||
); | ||
event PendingProxyAdminFunctionSet( | ||
bytes pendingProxyAdminFunction | ||
); | ||
|
||
event RecoveryHashUpdated( | ||
bytes32 oldHash, | ||
bytes32 newHash | ||
); | ||
event BLSKeySet( | ||
uint256[4] oldBLSKey, | ||
uint256[4] newBLSKey | ||
); | ||
event GatewayUpdated( | ||
address oldGateway, | ||
address newGateway | ||
); | ||
event ProxyAdminFunctionApproved( | ||
bytes approvedProxyAdmin | ||
); |
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.
Something to consider for the future would be to break this down into separate abstract component contracts that manage the state/pending/recovery of these sensitive fields. i.e. blsPublicKey
and its pending fields, events, mutators, and set pending calls, then have BLSWallet
inherit them. This would reduce the code size/complexity of BLSWallet.sol
, and make it easier to break out isolated unit test suites for them.
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.
Agreed, at that stage it would be good to factor in upgradability of wallets (bls and potentially non-bls). Which needs to consider the inheritance order since memory locations when upgrading are important. -> Created #73
What is this PR doing?
Adding recovery functionality to wallets
How can these changes be manually tested?
yarn hardhat test
fromcontracts
Does this PR resolve or contribute to any issues?
Closes #70
Checklist
Guidelines
resolve conversation
button is for reviewers, not authors