Open nkuba opened 3 years ago
I was testing this script locally with four operators:
0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416
0x7020a5556ba1ce5f92c81063a13d33512cf1305c
0x524f2e0176350d950fa630d9a5a59a0a190daf48
0x65ea55c1f10491038425725dc00dffeab2a1e28a
Initial state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬──────────────────────────────────────────────────┬────────────────────┬────────────────────┬──────────────────┬────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼──────────────────────────────────────────────────┼────────────────────┼────────────────────┼──────────────────┼────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996875216' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996874897' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996875535' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.883456701' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴──────────────────────────────────────────────────┴────────────────────┴────────────────────┴──────────────────┴────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Created keep 0x43293fFe178B64A7342a0346F9D57974DB22d3EC
with members:
524f2e0176350d950fa630d9a5a59a0a190daf48
,0x7020A5556Ba1ce5f92c81063a13d33512cf1305c
,0x65EA55c1f10491038425725dC00dFFEAb2A1e28A
.Intermediate state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────────┬────────────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┼────────────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996875216' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996733331' │ '50' │ '0' │ '49.999999999999999996' │ '0.000000000000000004' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996703122' │ '50' │ '0' │ '49.999999999999999996' │ '0.000000000000000004' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.899962083444444444' │ '50' │ '0' │ '49.999999999999999996' │ '0.000000000000000004' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────────┴────────────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Closed keep 0x43293fFe178B64A7342a0346F9D57974DB22d3EC
.
End state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬──────────────────┬────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼──────────────────┼────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996875216' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996733331' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996703122' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.899962083444444444' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴──────────────────┴────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Initial state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬──────────────────┬────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼──────────────────┼────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996875216' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996733331' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996703122' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.899962083444444444' │ '50' │ '0' │ '50' │ '0' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴──────────────────┴────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Created keep 0x6a613E21cc3Ea0D14eCa39Ac3131531F3296fDdc
with members:
3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416
,524f2e0176350d950fa630d9a5a59a0a190daf48
,65ea55c1f10491038425725dc00dffeab2a1e28a
.Created keep 0xddE46d893748662CE6102944f6cdA9517D0092D7
with members:
7020a5556ba1ce5f92c81063a13d33512cf1305c
,524f2e0176350d950fa630d9a5a59a0a190daf48
,3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416
.Created keep 0xcD1C4B4e17D0Ae5fCCc9150cfe23B67cb33364Fb
with members:
3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416
,65ea55c1f10491038425725dc00dffeab2a1e28a
,7020a5556ba1ce5f92c81063a13d33512cf1305c
.Intermediate state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────────┬────────────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┼────────────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996450858' │ '50' │ '0' │ '49.999999999999999988' │ '0.000000000000000012' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996454601' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996358004' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.949629693777777776' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────────┴────────────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Seized bonds from keep 0xcD1C4B4e17D0Ae5fCCc9150cfe23B67cb33364Fb
.
End state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────────┬────────────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┼────────────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996450858' │ '50' │ '0' │ '49.999999999999999988' │ '0.000000000000000008' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996454601' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000004' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996358004' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.949629693777777776' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000004' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────────┴────────────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Problem: Please see that seizedAmountEth
shows 0. I thought it's a precision issue and removed all fromWei
calls for seized bonds but it still shows 0
.
Initial state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────────┬────────────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┼────────────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996450858' │ '50' │ '0' │ '49.999999999999999988' │ '0.000000000000000008' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996454601' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000004' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996358004' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.949629693777777776' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000004' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────────┴────────────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Note that seizedAmountEth
value is not accurate - see the previous scenario.
Returned 12
wei to keep 0xcD1C4B4e17D0Ae5fCCc9150cfe23B67cb33364Fb
.
End state:
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────────────────────────────────────┬─────────────────────────┬────────────────────┬─────────────────────────┬────────────────────────┬─────────────────┬────────────────────────┬──────────────────────┐
│ (index) │ address │ eligibleStakeKeep │ operatorBalanceEth │ depositedAmountEth │ withdrawnAmountEth │ unbondedValueEth │ bondsAmountEth │ seizedAmountEth │ isRegisteredInTbtcPool │ isUpToDateInTbtcPool │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────────────────────────────────────┼─────────────────────────┼────────────────────┼─────────────────────────┼────────────────────────┼─────────────────┼────────────────────────┼──────────────────────┤
│ 0 │ '0x3365d0ed0e526d3b1d8b417fc0fde5b1cef2f416' │ '20000000' │ '999999999999999999999999999999999999.996450858' │ '50.000000000000000004' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
│ 1 │ '0x7020a5556ba1ce5f92c81063a13d33512cf1305c' │ '20000000' │ '999999999999999999999999999999999999.996454601' │ '50.000000000000000004' │ '0' │ '49.999999999999999996' │ '0.000000000000000004' │ '0' │ true │ true │
│ 2 │ '0x524f2e0176350d950fa630d9a5a59a0a190daf48' │ '20000000' │ '999999999999999999999999999999999999.996358004' │ '50' │ '0' │ '49.999999999999999992' │ '0.000000000000000008' │ '0' │ true │ true │
│ 3 │ '0x65ea55c1f10491038425725dc00dffeab2a1e28a' │ '20000000' │ '999999999999999999999999999999999999.949629693777777776' │ '50.000000000000000004' │ '0' │ '49.999999999999999996' │ '0.000000000000000004' │ '0' │ true │ true │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────────────────────────────────────┴─────────────────────────┴────────────────────┴─────────────────────────┴────────────────────────┴─────────────────┴────────────────────────┴──────────────────────┘
Problem: Please see that the depositedAmountEth
increased. It should never be higher than the initial 50 ETH.
We are getting bond creation events to obtain values of bonds created for all the ECDSA operators.