mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-06 09:42:19 +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 {
|
struct Notary {
|
||||||
uint deregisteredPeriod;
|
uint deregisteredPeriod;
|
||||||
uint poolIndex;
|
uint poolIndex;
|
||||||
|
uint balance;
|
||||||
bool deposited;
|
bool deposited;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +111,7 @@ contract SMC {
|
|||||||
notaryRegistry[notaryAddress] = Notary({
|
notaryRegistry[notaryAddress] = Notary({
|
||||||
deregisteredPeriod: 0,
|
deregisteredPeriod: 0,
|
||||||
poolIndex: index,
|
poolIndex: index,
|
||||||
|
balance: msg.value,
|
||||||
deposited: true
|
deposited: true
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -150,8 +152,9 @@ contract SMC {
|
|||||||
require(notaryRegistry[notaryAddress].deregisteredPeriod != 0);
|
require(notaryRegistry[notaryAddress].deregisteredPeriod != 0);
|
||||||
require((block.number / PERIOD_LENGTH) > (notaryRegistry[notaryAddress].deregisteredPeriod + NOTARY_LOCKUP_LENGTH));
|
require((block.number / PERIOD_LENGTH) > (notaryRegistry[notaryAddress].deregisteredPeriod + NOTARY_LOCKUP_LENGTH));
|
||||||
|
|
||||||
|
uint balance = notaryRegistry[notaryAddress].balance;
|
||||||
delete notaryRegistry[notaryAddress];
|
delete notaryRegistry[notaryAddress];
|
||||||
notaryAddress.transfer(NOTARY_DEPOSIT);
|
notaryAddress.transfer(balance);
|
||||||
emit NotaryReleased(notaryAddress, index);
|
emit NotaryReleased(notaryAddress, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user