mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 08:44:28 +00:00
sharding/contract: add balance to notary struct
Former-commit-id: 81d73e4fe4675b370160bd7b391dfe6fed17aaab [formerly 734e43220a976da1a88e4d19b2ec42f77020e351] Former-commit-id: a78e3fd7b345e8f032adc03aa567250b99c2aa1e
This commit is contained in:
parent
5359cf04a9
commit
56e90be294
File diff suppressed because one or more lines are too long
@ -11,6 +11,7 @@ contract SMC {
|
||||
struct Notary {
|
||||
uint deregisteredPeriod;
|
||||
uint poolIndex;
|
||||
uint balance;
|
||||
bool deposited;
|
||||
}
|
||||
|
||||
@ -110,6 +111,7 @@ contract SMC {
|
||||
notaryRegistry[notaryAddress] = Notary({
|
||||
deregisteredPeriod: 0,
|
||||
poolIndex: index,
|
||||
balance: msg.value,
|
||||
deposited: true
|
||||
});
|
||||
|
||||
@ -150,8 +152,9 @@ contract SMC {
|
||||
require(notaryRegistry[notaryAddress].deregisteredPeriod != 0);
|
||||
require((block.number / PERIOD_LENGTH) > (notaryRegistry[notaryAddress].deregisteredPeriod + NOTARY_LOCKUP_LENGTH));
|
||||
|
||||
uint balance = notaryRegistry[notaryAddress].balance;
|
||||
delete notaryRegistry[notaryAddress];
|
||||
notaryAddress.transfer(NOTARY_DEPOSIT);
|
||||
notaryAddress.transfer(balance);
|
||||
emit NotaryReleased(notaryAddress, index);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user