Skip to content

Commit

Permalink
feat(contracts): charge unjail fee add min delegation (#1267)
Browse files Browse the repository at this point in the history
Charge fee for unjail calls, add min delegation. 

task: https://app.asana.com/0/1206208509925075/1207614497286533
  • Loading branch information
kevinhalliday authored Jun 20, 2024
1 parent 869aed8 commit 83e419f
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 55 deletions.
4 changes: 2 additions & 2 deletions contracts/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ Quorum_Test:test_verify_noSigs_fails() (gas: 266340)
Quorum_Test:test_verify_powerBasedQourum_succeeds() (gas: 783231)
Quorum_Test:test_verify_sigsNotSorted_reverts() (gas: 283676)
Quorum_Test:test_verify_succeeds() (gas: 295162)
Slashing_Test:test_unjail() (gas: 12494)
Staking_Test:test_createValidator() (gas: 102796)
Slashing_Test:test_unjail() (gas: 54678)
Staking_Test:test_createValidator() (gas: 102891)
10 changes: 5 additions & 5 deletions contracts/bindings/omnibridgenative_storage_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,39 @@
"type": "t_array(t_uint256)49_storage"
},
{
"astId": 52041,
"astId": 52062,
"contract": "src/token/OmniBridgeNative.sol:OmniBridgeNative",
"label": "l1ChainId",
"offset": 0,
"slot": "101",
"type": "t_uint64"
},
{
"astId": 52045,
"astId": 52066,
"contract": "src/token/OmniBridgeNative.sol:OmniBridgeNative",
"label": "omni",
"offset": 8,
"slot": "101",
"type": "t_contract(IOmniPortal)51054"
},
{
"astId": 52048,
"astId": 52069,
"contract": "src/token/OmniBridgeNative.sol:OmniBridgeNative",
"label": "l1BridgeBalance",
"offset": 0,
"slot": "102",
"type": "t_uint256"
},
{
"astId": 52051,
"astId": 52072,
"contract": "src/token/OmniBridgeNative.sol:OmniBridgeNative",
"label": "l1Bridge",
"offset": 0,
"slot": "103",
"type": "t_address"
},
{
"astId": 52056,
"astId": 52077,
"contract": "src/token/OmniBridgeNative.sol:OmniBridgeNative",
"label": "claimable",
"offset": 0,
Expand Down
20 changes: 10 additions & 10 deletions contracts/bindings/portalregistry_storage_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
"type": "t_array(t_uint256)49_storage"
},
{
"astId": 52751,
"astId": 54873,
"contract": "src/xchain/PortalRegistry.sol:PortalRegistry",
"label": "chainIds",
"offset": 0,
"slot": "101",
"type": "t_array(t_uint64)dyn_storage"
},
{
"astId": 52757,
"astId": 54879,
"contract": "src/xchain/PortalRegistry.sol:PortalRegistry",
"label": "deployments",
"offset": 0,
"slot": "102",
"type": "t_mapping(t_uint64,t_struct(Deployment)52768_storage)"
"type": "t_mapping(t_uint64,t_struct(Deployment)54890_storage)"
}
],
"types": {
Expand Down Expand Up @@ -86,44 +86,44 @@
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_uint64,t_struct(Deployment)52768_storage)": {
"t_mapping(t_uint64,t_struct(Deployment)54890_storage)": {
"encoding": "mapping",
"key": "t_uint64",
"label": "mapping(uint64 => struct PortalRegistry.Deployment)",
"numberOfBytes": "32",
"value": "t_struct(Deployment)52768_storage"
"value": "t_struct(Deployment)54890_storage"
},
"t_struct(Deployment)52768_storage": {
"t_struct(Deployment)54890_storage": {
"encoding": "inplace",
"label": "struct PortalRegistry.Deployment",
"numberOfBytes": "96",
"members": [
{
"astId": 52760,
"astId": 54882,
"contract": "src/xchain/PortalRegistry.sol:PortalRegistry",
"label": "chainId",
"offset": 0,
"slot": "0",
"type": "t_uint64"
},
{
"astId": 52762,
"astId": 54884,
"contract": "src/xchain/PortalRegistry.sol:PortalRegistry",
"label": "addr",
"offset": 8,
"slot": "0",
"type": "t_address"
},
{
"astId": 52764,
"astId": 54886,
"contract": "src/xchain/PortalRegistry.sol:PortalRegistry",
"label": "deployHeight",
"offset": 0,
"slot": "1",
"type": "t_uint64"
},
{
"astId": 52767,
"astId": 54889,
"contract": "src/xchain/PortalRegistry.sol:PortalRegistry",
"label": "shards",
"offset": 0,
Expand Down
41 changes: 36 additions & 5 deletions contracts/bindings/slashing.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/bindings/slashing_more.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

const (
SlashingDeployedBytecode = "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063f679d30514602d575b600080fd5b60336035565b005b60405133907fc3ef55ddda4bc9300706e15ab3aed03c762d8afd43a7d358a7b9503cb39f281b90600090a256fea264697066735822122046125cf3aa1770dee7f65080efcf7560c19924e2c15e3b3fec4cb1deb26fda5164736f6c63430008180033"
SlashingDeployedBytecode = "0x6080604052600436106100295760003560e01c8063bef7a2f01461002e578063f679d3051461005c575b600080fd5b34801561003a57600080fd5b5061004a67016345785d8a000081565b60405190815260200160405180910390f35b610064610066565b005b61006e61009b565b60405133907fc3ef55ddda4bc9300706e15ab3aed03c762d8afd43a7d358a7b9503cb39f281b90600090a2565b67016345785d8a00003410156100f75760405162461bcd60e51b815260206004820152601a60248201527f536c617368696e673a20696e73756666696369656e7420666565000000000000604482015260640160405180910390fd5b60405161dead903480156108fc02916000818181858888f19350505050158015610125573d6000803e3d6000fd5b5056fea26469706673582212208eb43e7331ab8c5760d0fd8f974b525a4b278f17e70419cb5695144ce1f0676e64736f6c63430008180033"
)

//go:embed slashing_storage_layout.json
Expand Down
Loading

0 comments on commit 83e419f

Please sign in to comment.