Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ update:; forge update

# Build & test
build :; forge build --sizes
test :; forge test -vvv
test :; forge test -vvv --no-match-path 'tests/fork/**'

# Mainnet-fork upgrade-safety suite (requires RPC_MAINNET; pin a block with FORK_BLOCK=<n>)
test-fork :; forge test -vvv --match-path 'tests/fork/**'

# Utilities
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}
Expand Down
6 changes: 3 additions & 3 deletions snapshots/ConfigPositionManager.Operations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"setCanUpdateUserDynamicConfigPermission": "50158",
"setCanUpdateUserRiskPremiumPermission": "50158",
"setGlobalPermission": "50110",
"setUsingAsCollateralOnBehalfOf": "77828",
"updateUserDynamicConfigOnBehalfOf": "52342",
"updateUserRiskPremiumOnBehalfOf": "140135"
"setUsingAsCollateralOnBehalfOf": "78361",
"updateUserDynamicConfigOnBehalfOf": "57354",
"updateUserRiskPremiumOnBehalfOf": "145038"
}
4 changes: 2 additions & 2 deletions snapshots/GiverPositionManager.Operations.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"repayOnBehalfOf": "176497",
"supplyOnBehalfOf": "143072"
"repayOnBehalfOf": "177119",
"supplyOnBehalfOf": "143426"
}
12 changes: 6 additions & 6 deletions snapshots/NativeTokenGateway.Operations.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"borrowNative": "238707",
"repayNative": "172321",
"supplyAsCollateralNative": "165113",
"supplyNative": "139728",
"withdrawNative: full": "129898",
"withdrawNative: partial": "142172"
"borrowNative": "245575",
"repayNative": "172943",
"supplyAsCollateralNative": "165840",
"supplyNative": "140082",
"withdrawNative: full": "130096",
"withdrawNative: partial": "142419"
}
2 changes: 1 addition & 1 deletion snapshots/PositionManagerBase.Operations.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"setSelfAsUserPositionManagerWithSig": "75041"
"setSelfAsUserPositionManagerWithSig": "75029"
}
16 changes: 8 additions & 8 deletions snapshots/SignatureGateway.Operations.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"borrowWithSig": "222144",
"repayWithSig": "192513",
"setSelfAsUserPositionManagerWithSig": "75138",
"setUsingAsCollateralWithSig": "85380",
"supplyWithSig": "155914",
"updateUserDynamicConfigWithSig": "63113",
"updateUserRiskPremiumWithSig": "61995",
"withdrawWithSig": "135124"
"borrowWithSig": "229167",
"repayWithSig": "193135",
"setSelfAsUserPositionManagerWithSig": "75126",
"setUsingAsCollateralWithSig": "85665",
"supplyWithSig": "156268",
"updateUserDynamicConfigWithSig": "68089",
"updateUserRiskPremiumWithSig": "66249",
"withdrawWithSig": "135321"
}
12 changes: 7 additions & 5 deletions snapshots/Spoke.Getters.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"getUserAccountData: supplies: 0, borrows: 0": "13014",
"getUserAccountData: supplies: 1, borrows: 0": "56072",
"getUserAccountData: supplies: 2, borrows: 0": "89894",
"getUserAccountData: supplies: 2, borrows: 1": "112389",
"getUserAccountData: supplies: 2, borrows: 2": "133792"
"getUserAccountData (positionSalt): supplies: 1, borrows: 0": "59912",
"getUserAccountData (positionSalt): supplies: 2, borrows: 1": "116758",
"getUserAccountData: supplies: 0, borrows: 0": "17361",
"getUserAccountData: supplies: 1, borrows: 0": "60561",
"getUserAccountData: supplies: 2, borrows: 0": "94432",
"getUserAccountData: supplies: 2, borrows: 1": "117407",
"getUserAccountData: supplies: 2, borrows: 2": "138569"
}
29 changes: 29 additions & 0 deletions snapshots/Spoke.Operations.PositionSalt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"borrow: first": "275121",
"borrow: second action, same reserve": "217987",
"liquidationCall (receiveShares): full": "354539",
"liquidationCall (receiveShares): partial": "353957",
"liquidationCall (reportDeficit): full": "377878",
"liquidationCall: full": "373075",
"liquidationCall: partial": "372493",
"repay: full": "124224",
"repay: partial": "143600",
"supply + enable collateral (multicall)": "165399",
"supply: 0 borrows, collateral disabled": "129220",
"supply: 0 borrows, collateral enabled": "112191",
"supply: second action, same reserve": "112120",
"updateUserDynamicConfig: 1 collateral": "82893",
"updateUserDynamicConfig: 2 collaterals": "100176",
"updateUserRiskPremium: 1 borrow": "164520",
"updateUserRiskPremium: 2 borrows": "215966",
"usingAsCollateral: 0 borrows, enable": "59876",
"usingAsCollateral: 1 borrow, disable": "175274",
"usingAsCollateral: 1 borrow, enable": "42764",
"usingAsCollateral: 2 borrows, disable": "248127",
"usingAsCollateral: 2 borrows, enable": "42776",
"withdraw: 0 borrows, full": "141390",
"withdraw: 0 borrows, partial": "147177",
"withdraw: 1 borrow, partial": "228420",
"withdraw: 2 borrows, partial": "277319",
"withdraw: non collateral": "112134"
}
62 changes: 31 additions & 31 deletions snapshots/Spoke.Operations.ZeroRiskPremium.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"borrow: first": "199509",
"borrow: second action, same reserve": "179375",
"liquidationCall (receiveShares): full": "314227",
"liquidationCall (receiveShares): partial": "313645",
"liquidationCall (reportDeficit): full": "380307",
"liquidationCall: full": "332763",
"liquidationCall: partial": "332181",
"permitReserve + repay (multicall)": "169938",
"permitReserve + supply (multicall)": "151663",
"permitReserve + supply + enable collateral (multicall)": "166114",
"repay: full": "129276",
"repay: partial": "134234",
"setUserPositionManagersWithSig: disable": "46772",
"borrow: first": "206210",
"borrow: second action, same reserve": "186076",
"liquidationCall (receiveShares): full": "321243",
"liquidationCall (receiveShares): partial": "320661",
"liquidationCall (reportDeficit): full": "385225",
"liquidationCall: full": "339779",
"liquidationCall: partial": "339197",
"permitReserve + repay (multicall)": "170580",
"permitReserve + supply (multicall)": "152215",
"permitReserve + supply + enable collateral (multicall)": "166951",
"repay: full": "129588",
"repay: partial": "134564",
"setUserPositionManagersWithSig: disable": "46760",
"setUserPositionManagersWithSig: enable": "68684",
"supply + enable collateral (multicall)": "146316",
"supply: 0 borrows, collateral disabled": "127753",
"supply: 0 borrows, collateral enabled": "110724",
"supply: second action, same reserve": "110653",
"updateUserDynamicConfig: 1 collateral": "76251",
"updateUserDynamicConfig: 2 collaterals": "92825",
"updateUserRiskPremium: 1 borrow": "104446",
"updateUserRiskPremium: 2 borrows": "114563",
"usingAsCollateral: 0 borrows, enable": "59616",
"usingAsCollateral: 1 borrow, disable": "114490",
"usingAsCollateral: 1 borrow, enable": "42504",
"usingAsCollateral: 2 borrows, disable": "138182",
"usingAsCollateral: 2 borrows, enable": "42516",
"withdraw: 0 borrows, full": "135058",
"withdraw: 0 borrows, partial": "140394",
"withdraw: 1 borrow, partial": "169591",
"withdraw: 2 borrows, partial": "186292",
"withdraw: non collateral": "111299"
"supply + enable collateral (multicall)": "147109",
"supply: 0 borrows, collateral disabled": "127975",
"supply: 0 borrows, collateral enabled": "110946",
"supply: second action, same reserve": "110875",
"updateUserDynamicConfig: 1 collateral": "82031",
"updateUserDynamicConfig: 2 collaterals": "99314",
"updateUserRiskPremium: 1 borrow": "109235",
"updateUserRiskPremium: 2 borrows": "119278",
"usingAsCollateral: 0 borrows, enable": "59901",
"usingAsCollateral: 1 borrow, disable": "121143",
"usingAsCollateral: 1 borrow, enable": "42789",
"usingAsCollateral: 2 borrows, disable": "144593",
"usingAsCollateral: 2 borrows, enable": "42801",
"withdraw: 0 borrows, full": "140582",
"withdraw: 0 borrows, partial": "146369",
"withdraw: 1 borrow, partial": "175960",
"withdraw: 2 borrows, partial": "192419",
"withdraw: non collateral": "111326"
}
62 changes: 31 additions & 31 deletions snapshots/Spoke.Operations.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"borrow: first": "269297",
"borrow: second action, same reserve": "212163",
"liquidationCall (receiveShares): full": "347124",
"liquidationCall (receiveShares): partial": "346542",
"liquidationCall (reportDeficit): full": "372507",
"liquidationCall: full": "365660",
"liquidationCall: partial": "365078",
"permitReserve + repay (multicall)": "166334",
"permitReserve + supply (multicall)": "151663",
"permitReserve + supply + enable collateral (multicall)": "166114",
"repay: full": "123355",
"repay: partial": "142713",
"setUserPositionManagersWithSig: disable": "46772",
"borrow: first": "275945",
"borrow: second action, same reserve": "218811",
"liquidationCall (receiveShares): full": "354086",
"liquidationCall (receiveShares): partial": "353504",
"liquidationCall (reportDeficit): full": "377425",
"liquidationCall: full": "372622",
"liquidationCall: partial": "372040",
"permitReserve + repay (multicall)": "166848",
"permitReserve + supply (multicall)": "152215",
"permitReserve + supply + enable collateral (multicall)": "166951",
"repay: full": "123667",
"repay: partial": "143043",
"setUserPositionManagersWithSig: disable": "46760",
"setUserPositionManagersWithSig: enable": "68684",
"supply + enable collateral (multicall)": "146316",
"supply: 0 borrows, collateral disabled": "127753",
"supply: 0 borrows, collateral enabled": "110724",
"supply: second action, same reserve": "110653",
"updateUserDynamicConfig: 1 collateral": "76251",
"updateUserDynamicConfig: 2 collaterals": "92825",
"updateUserRiskPremium: 1 borrow": "158658",
"updateUserRiskPremium: 2 borrows": "210210",
"usingAsCollateral: 0 borrows, enable": "59616",
"usingAsCollateral: 1 borrow, disable": "168699",
"usingAsCollateral: 1 borrow, enable": "42504",
"usingAsCollateral: 2 borrows, disable": "241825",
"usingAsCollateral: 2 borrows, enable": "42516",
"withdraw: 0 borrows, full": "135058",
"withdraw: 0 borrows, partial": "140394",
"withdraw: 1 borrow, partial": "221298",
"withdraw: 2 borrows, partial": "270470",
"withdraw: non collateral": "111299"
"supply + enable collateral (multicall)": "147109",
"supply: 0 borrows, collateral disabled": "127975",
"supply: 0 borrows, collateral enabled": "110946",
"supply: second action, same reserve": "110875",
"updateUserDynamicConfig: 1 collateral": "82031",
"updateUserDynamicConfig: 2 collaterals": "99314",
"updateUserRiskPremium: 1 borrow": "163394",
"updateUserRiskPremium: 2 borrows": "214840",
"usingAsCollateral: 0 borrows, enable": "59901",
"usingAsCollateral: 1 borrow, disable": "175299",
"usingAsCollateral: 1 borrow, enable": "42789",
"usingAsCollateral: 2 borrows, disable": "248152",
"usingAsCollateral: 2 borrows, enable": "42801",
"withdraw: 0 borrows, full": "140582",
"withdraw: 0 borrows, partial": "146369",
"withdraw: 1 borrow, partial": "227612",
"withdraw: 2 borrows, partial": "276511",
"withdraw: non collateral": "111326"
}
8 changes: 4 additions & 4 deletions snapshots/TakerPositionManager.Operations.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"approveBorrow": "49807",
"approveBorrowWithSig": "65689",
"approveBorrowWithSig": "65677",
"approveWithdraw": "49816",
"approveWithdrawWithSig": "65643",
"borrowOnBehalfOf": "332512",
"borrowOnBehalfOf": "339691",
"renounceBorrowAllowance": "27929",
"renounceWithdrawAllowance": "27983",
"withdrawOnBehalfOf: full": "127209",
"withdrawOnBehalfOf: partial": "138811"
"withdrawOnBehalfOf: full": "127407",
"withdrawOnBehalfOf: partial": "139058"
}
10 changes: 7 additions & 3 deletions src/deployments/utils/libraries/Roles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ library Roles {

/// @notice Returns the function selectors associated with the Spoke Position Updater role.
function getSpokePositionUpdaterRoleSelectors() internal pure returns (bytes4[] memory) {
bytes4[] memory selectors = new bytes4[](2);
selectors[0] = ISpoke.updateUserDynamicConfig.selector;
selectors[1] = ISpoke.updateUserRiskPremium.selector;
bytes4[] memory selectors = new bytes4[](4);
// `updateUserDynamicConfig` and `updateUserRiskPremium` are overloaded, so their selectors are
// referenced by explicit signature to gate both the default and salted position variants.
selectors[0] = bytes4(keccak256('updateUserDynamicConfig(address)'));
selectors[1] = bytes4(keccak256('updateUserDynamicConfig(address,bytes32)'));
selectors[2] = bytes4(keccak256('updateUserRiskPremium(address)'));
selectors[3] = bytes4(keccak256('updateUserRiskPremium(address,bytes32)'));
return selectors;
}

Expand Down
Loading
Loading