Skip to content

Commit

Permalink
Merge pull request #203 from balancer/fix_permisisons_generator
Browse files Browse the repository at this point in the history
fix: Handle no permission data at all for a chain.
  • Loading branch information
Tritium-VLK authored May 20, 2024
2 parents 4e3ddb7 + be1511c commit d744ebf
Show file tree
Hide file tree
Showing 21 changed files with 436 additions and 868 deletions.
7 changes: 6 additions & 1 deletion .github/python_actions/full_chain_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
def build_chain_permissions_list(chain_name):
results = []
addrs = AddrBook(chain_name)
perms = BalPermissions(chain_name)
try:
perms = BalPermissions(chain_name)
except Exception as e:
print(f"WARNING: No permissions found for chain {chain_name}: {e}")
return []
for action_id, callers in perms.active_permissions_by_action_id.items():
fx_paths = perms.paths_by_action_id[action_id]
for fx_path in fx_paths:
Expand Down Expand Up @@ -129,6 +133,7 @@ def generate_chain_files(chain):
else:
print(f"WARNING: No permissions found for chain {chain}")


def main():
for chain in AddrBook.chain_ids_by_name.keys():
print(f"\n\n\nWriting docs for {chain.capitalize()}\n\n\n")
Expand Down
9 changes: 8 additions & 1 deletion data_files/permissions/arbitrum.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ disable(),ComposableStablePoolFactory,20220906-composable-stable-pool,"['0x56ebA
disable(),ComposableStablePoolFactory,20221122-composable-stable-pool-v2,"['0x56ebA8dcDcEC3161Dd220c4B4131c27aF201F892', '0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D']","['multisigs/blabs_ops', 'multisigs/emergency']"
disable(),ComposableStablePoolFactory,20230206-composable-stable-pool-v3,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xaF23DC5983230E9eEAf93280e312e57539D098D0']","['multisigs/emergency', 'multisigs/dao']"
disable(),ComposableStablePoolFactory,20230320-composable-stable-pool-v4,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disable(),ComposableStablePoolFactory,20230711-composable-stable-pool-v5,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disable(),ComposableStablePoolFactory,20230711-composable-stable-pool-v5,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xc38c5f97B34E175FFd35407fc91a937300E33860']","['multisigs/emergency', 'multisigs/lm']"
disable(),ComposableStablePoolFactory,20240223-composable-stable-pool-v6,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disable(),ERC4626LinearPoolFactory,20230206-erc4626-linear-pool-v3,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xaF23DC5983230E9eEAf93280e312e57539D098D0']","['multisigs/emergency', 'multisigs/dao']"
disable(),ERC4626LinearPoolFactory,20230409-erc4626-linear-pool-v4,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disable(),ManagedPoolFactory,20221021-managed-pool,"['0x56ebA8dcDcEC3161Dd220c4B4131c27aF201F892', '0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xaF23DC5983230E9eEAf93280e312e57539D098D0']","['multisigs/blabs_ops', 'multisigs/emergency', 'multisigs/dao']"
Expand All @@ -29,6 +30,7 @@ disableRecoveryMode(),ComposableStablePool,20221122-composable-stable-pool-v2,['
disableRecoveryMode(),ComposableStablePool,20230206-composable-stable-pool-v3,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disableRecoveryMode(),ComposableStablePool,20230320-composable-stable-pool-v4,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disableRecoveryMode(),ComposableStablePool,20230711-composable-stable-pool-v5,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disableRecoveryMode(),ComposableStablePool,20240223-composable-stable-pool-v6,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disableRecoveryMode(),WeightedPool,20230206-weighted-pool-v3,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
disableRecoveryMode(),WeightedPool,20230320-weighted-pool-v4,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
enableRecoveryMode(),AaveLinearPool,20220817-aave-rebalanced-linear-pool,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
Expand All @@ -40,6 +42,7 @@ enableRecoveryMode(),ComposableStablePool,20221122-composable-stable-pool-v2,"['
enableRecoveryMode(),ComposableStablePool,20230206-composable-stable-pool-v3,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2']","['multisigs/emergency', '20221123-pool-recovery-helper/PoolRecoveryHelper']"
enableRecoveryMode(),ComposableStablePool,20230320-composable-stable-pool-v4,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2']","['multisigs/emergency', '20221123-pool-recovery-helper/PoolRecoveryHelper']"
enableRecoveryMode(),ComposableStablePool,20230711-composable-stable-pool-v5,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2']","['multisigs/emergency', '20221123-pool-recovery-helper/PoolRecoveryHelper']"
enableRecoveryMode(),ComposableStablePool,20240223-composable-stable-pool-v6,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2']","['multisigs/emergency', '20221123-pool-recovery-helper/PoolRecoveryHelper']"
enableRecoveryMode(),ERC4626LinearPool,20230206-erc4626-linear-pool-v3,['0xaF23DC5983230E9eEAf93280e312e57539D098D0'],['multisigs/dao']
enableRecoveryMode(),ERC4626LinearPool,20230409-erc4626-linear-pool-v4,"['0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2', '0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D']","['20221123-pool-recovery-helper/PoolRecoveryHelper', 'multisigs/emergency']"
enableRecoveryMode(),ManagedPool,20230411-managed-pool-v2,"['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D', '0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2']","['multisigs/emergency', '20221123-pool-recovery-helper/PoolRecoveryHelper']"
Expand All @@ -60,6 +63,7 @@ pause(),ComposableStablePool,20221122-composable-stable-pool-v2,['0xf404C5a0c023
pause(),ComposableStablePool,20230206-composable-stable-pool-v3,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
pause(),ComposableStablePool,20230320-composable-stable-pool-v4,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
pause(),ComposableStablePool,20230711-composable-stable-pool-v5,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
pause(),ComposableStablePool,20240223-composable-stable-pool-v6,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
pause(),ERC4626LinearPool,20230409-erc4626-linear-pool-v4,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
pause(),ManagedPool,20230411-managed-pool-v2,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
pause(),WeightedPool,20220908-weighted-pool-v2,['0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D'],['multisigs/emergency']
Expand All @@ -81,6 +85,7 @@ setSwapFeePercentage(uint256),ComposableStablePool,20221122-composable-stable-po
setSwapFeePercentage(uint256),ComposableStablePool,20230206-composable-stable-pool-v3,"['0x7c68c42De679ffB0f16216154C996C354cF1161B', '0xad3b67BCA8935Cb510C8D18bD45F0b94F54A968f']","['multisigs/feeManager', 'UNDEF']"
setSwapFeePercentage(uint256),ComposableStablePool,20230320-composable-stable-pool-v4,"['0xc38c5f97B34E175FFd35407fc91a937300E33860', '0xad3b67BCA8935Cb510C8D18bD45F0b94F54A968f']","['multisigs/lm', 'UNDEF']"
setSwapFeePercentage(uint256),ComposableStablePool,20230711-composable-stable-pool-v5,"['0xc38c5f97B34E175FFd35407fc91a937300E33860', '0xad3b67BCA8935Cb510C8D18bD45F0b94F54A968f']","['multisigs/lm', 'UNDEF']"
setSwapFeePercentage(uint256),ComposableStablePool,20240223-composable-stable-pool-v6,"['0xad3b67BCA8935Cb510C8D18bD45F0b94F54A968f', '0xc38c5f97B34E175FFd35407fc91a937300E33860']","['UNDEF', 'multisigs/lm']"
setSwapFeePercentage(uint256),ERC4626LinearPool,20230206-erc4626-linear-pool-v3,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
setSwapFeePercentage(uint256),ERC4626LinearPool,20230409-erc4626-linear-pool-v4,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
setSwapFeePercentage(uint256),ProtocolFeesCollector,20210418-vault,"['0x6207ed574152496c9B072C24FD87cE9cd9E17320', '0x5ef4c5352882b10893b70DbcaA0C000965bd23c5']","['UNDEF', '20220725-protocol-fee-percentages-provider/ProtocolFeePercentagesProvider']"
Expand Down Expand Up @@ -108,13 +113,15 @@ setSwapFeePercentage(uint256),YearnLinearPool,20230409-yearn-linear-pool-v2,['0x
"startAmplificationParameterUpdate(uint256,uint256)",ComposableStablePool,20230206-composable-stable-pool-v3,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
"startAmplificationParameterUpdate(uint256,uint256)",ComposableStablePool,20230320-composable-stable-pool-v4,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
"startAmplificationParameterUpdate(uint256,uint256)",ComposableStablePool,20230711-composable-stable-pool-v5,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
"startAmplificationParameterUpdate(uint256,uint256)",ComposableStablePool,20240223-composable-stable-pool-v6,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
"startAmplificationParameterUpdate(uint256,uint256)",StablePool,20210624-stable-pool,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
"startAmplificationParameterUpdate(uint256,uint256)",StablePool,20220609-stable-pool-v2,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
stopAmplificationParameterUpdate(),ComposableStablePool,20220906-composable-stable-pool,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
stopAmplificationParameterUpdate(),ComposableStablePool,20221122-composable-stable-pool-v2,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
stopAmplificationParameterUpdate(),ComposableStablePool,20230206-composable-stable-pool-v3,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
stopAmplificationParameterUpdate(),ComposableStablePool,20230320-composable-stable-pool-v4,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
stopAmplificationParameterUpdate(),ComposableStablePool,20230711-composable-stable-pool-v5,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
stopAmplificationParameterUpdate(),ComposableStablePool,20240223-composable-stable-pool-v6,['0xc38c5f97B34E175FFd35407fc91a937300E33860'],['multisigs/lm']
stopAmplificationParameterUpdate(),StablePool,20210624-stable-pool,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
stopAmplificationParameterUpdate(),StablePool,20220609-stable-pool-v2,['0x7c68c42De679ffB0f16216154C996C354cF1161B'],['multisigs/feeManager']
"swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)",Vault,20210418-vault,"['0x466262c2a275aB106E54D95B5B04603e12b58cA1', '0x42E49B48573c725ee32d2579060Ed06894f97002', '0x5bf3B7c14b10f16939d63Bd679264A1Aa951B4D5', '0x598ce0f1ab64B27256759ef99d883EE51138b9bd', '0x9B892E515D2Ab8869F17488d64B3b918731cc70d']","['20211203-batch-relayer/BalancerRelayer', '20220720-batch-relayer-v3/BalancerRelayer', '20220916-batch-relayer-v4/BalancerRelayer', '20230314-batch-relayer-v5/BalancerRelayer', '20231031-batch-relayer-v6/BalancerRelayer']"
Expand Down
87 changes: 85 additions & 2 deletions data_files/permissions/arbitrum.json
Original file line number Diff line number Diff line change
Expand Up @@ -1424,10 +1424,12 @@
"Contract": "ComposableStablePoolFactory",
"Deployment": "20230711-composable-stable-pool-v5",
"Authorized_Caller_Addresses": [
"0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D"
"0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D",
"0xc38c5f97B34E175FFd35407fc91a937300E33860"
],
"Authorized_Caller_Names": [
"multisigs/emergency"
"multisigs/emergency",
"multisigs/lm"
]
},
{
Expand Down Expand Up @@ -1499,5 +1501,86 @@
"Authorized_Caller_Names": [
"multisigs/lm"
]
},
{
"Fx": "disable()",
"Contract": "ComposableStablePoolFactory",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D"
],
"Authorized_Caller_Names": [
"multisigs/emergency"
]
},
{
"Fx": "disableRecoveryMode()",
"Contract": "ComposableStablePool",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D"
],
"Authorized_Caller_Names": [
"multisigs/emergency"
]
},
{
"Fx": "enableRecoveryMode()",
"Contract": "ComposableStablePool",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D",
"0xb5e56CC3d2e38e53b1166175C59e921A37cDC1E2"
],
"Authorized_Caller_Names": [
"multisigs/emergency",
"20221123-pool-recovery-helper/PoolRecoveryHelper"
]
},
{
"Fx": "pause()",
"Contract": "ComposableStablePool",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xf404C5a0c02397f0908A3524fc5eb84e68Bbe60D"
],
"Authorized_Caller_Names": [
"multisigs/emergency"
]
},
{
"Fx": "setSwapFeePercentage(uint256)",
"Contract": "ComposableStablePool",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xad3b67BCA8935Cb510C8D18bD45F0b94F54A968f",
"0xc38c5f97B34E175FFd35407fc91a937300E33860"
],
"Authorized_Caller_Names": [
"UNDEF",
"multisigs/lm"
]
},
{
"Fx": "startAmplificationParameterUpdate(uint256,uint256)",
"Contract": "ComposableStablePool",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xc38c5f97B34E175FFd35407fc91a937300E33860"
],
"Authorized_Caller_Names": [
"multisigs/lm"
]
},
{
"Fx": "stopAmplificationParameterUpdate()",
"Contract": "ComposableStablePool",
"Deployment": "20240223-composable-stable-pool-v6",
"Authorized_Caller_Addresses": [
"0xc38c5f97B34E175FFd35407fc91a937300E33860"
],
"Authorized_Caller_Names": [
"multisigs/lm"
]
}
]
172 changes: 1 addition & 171 deletions data_files/permissions/fantom.json
Original file line number Diff line number Diff line change
@@ -1,171 +1 @@
[
{
"Fx": "batchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool),int256[],uint256)",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x419F7925b8C9e409B6Ee8792242556fa210A7A09",
"0x43A6C3Cd50776297Baa34d92217E1181BAF9C9B4",
"0xe273ED010295c69b652d93De4390234042065258",
"0x7701711545830ec044a5907f8292950e24B6a011",
"0x0faA25293A36241C214F3760C6FF443e1b731981"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF"
]
},
{
"Fx": "exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x419F7925b8C9e409B6Ee8792242556fa210A7A09",
"0x43A6C3Cd50776297Baa34d92217E1181BAF9C9B4",
"0xe273ED010295c69b652d93De4390234042065258",
"0x7701711545830ec044a5907f8292950e24B6a011",
"0x0faA25293A36241C214F3760C6FF443e1b731981"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF"
]
},
{
"Fx": "joinPool(bytes32,address,address,(address[],uint256[],bytes,bool))",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x419F7925b8C9e409B6Ee8792242556fa210A7A09",
"0x43A6C3Cd50776297Baa34d92217E1181BAF9C9B4",
"0xe273ED010295c69b652d93De4390234042065258",
"0x7701711545830ec044a5907f8292950e24B6a011",
"0x0faA25293A36241C214F3760C6FF443e1b731981"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF"
]
},
{
"Fx": "manageUserBalance((uint8,address,uint256,address,address)[])",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x419F7925b8C9e409B6Ee8792242556fa210A7A09",
"0x43A6C3Cd50776297Baa34d92217E1181BAF9C9B4",
"0xe273ED010295c69b652d93De4390234042065258",
"0x7701711545830ec044a5907f8292950e24B6a011",
"0x0faA25293A36241C214F3760C6FF443e1b731981"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF"
]
},
{
"Fx": "setAuthorizer(address)",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x9d0327954009C59eD70Dc98b7726e911879d4D92"
],
"Authorized_Caller_Names": [
"UNDEF"
]
},
{
"Fx": "setPaused(bool)",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x9d0327954009C59eD70Dc98b7726e911879d4D92"
],
"Authorized_Caller_Names": [
"UNDEF"
]
},
{
"Fx": "setRelayerApproval(address,address,bool)",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x419F7925b8C9e409B6Ee8792242556fa210A7A09",
"0x43A6C3Cd50776297Baa34d92217E1181BAF9C9B4",
"0x7701711545830ec044a5907f8292950e24B6a011",
"0x0faA25293A36241C214F3760C6FF443e1b731981"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF"
]
},
{
"Fx": "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)",
"Contract": "Vault",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x419F7925b8C9e409B6Ee8792242556fa210A7A09",
"0x43A6C3Cd50776297Baa34d92217E1181BAF9C9B4",
"0xe273ED010295c69b652d93De4390234042065258",
"0x7701711545830ec044a5907f8292950e24B6a011",
"0x0faA25293A36241C214F3760C6FF443e1b731981"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF",
"UNDEF"
]
},
{
"Fx": "setFlashLoanFeePercentage(uint256)",
"Contract": "ProtocolFeesCollector",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x9d0327954009C59eD70Dc98b7726e911879d4D92"
],
"Authorized_Caller_Names": [
"UNDEF"
]
},
{
"Fx": "setSwapFeePercentage(uint256)",
"Contract": "ProtocolFeesCollector",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x9d0327954009C59eD70Dc98b7726e911879d4D92"
],
"Authorized_Caller_Names": [
"UNDEF"
]
},
{
"Fx": "withdrawCollectedFees(address[],uint256[],address)",
"Contract": "ProtocolFeesCollector",
"Deployment": "20210418-vault",
"Authorized_Caller_Addresses": [
"0x9d0327954009C59eD70Dc98b7726e911879d4D92",
"0xA09BC385421f18D5d5072924f9d3709bB2B76281"
],
"Authorized_Caller_Names": [
"UNDEF",
"UNDEF"
]
}
]
[]
1 change: 1 addition & 0 deletions data_files/permissions/fraxtal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Loading

0 comments on commit d744ebf

Please sign in to comment.