setup_gmx_whitelisting
Documentation for eth_defi.gmx.whitelist.setup_gmx_whitelisting function.
- setup_gmx_whitelisting(guard, gmx_deployment, owner, safe_address)
Set up complete GMX whitelisting on a Guard contract.
This function performs all necessary whitelisting for GMX trading:
Whitelist GMX router contracts (ExchangeRouter, SyntheticsRouter, OrderVault)
Whitelist the Safe as a receiver
Whitelist all specified markets
Optionally whitelist collateral tokens
Example:
from eth_defi.gmx.whitelist import GMXDeployment, setup_gmx_whitelisting gmx = GMXDeployment.create_arbitrum( markets=["0x70d95587d40A2caf56bd97485aB3Eec10Bee6336"], ) tx_hashes = setup_gmx_whitelisting( guard=guard_contract, gmx_deployment=gmx, owner=safe_address, safe_address=safe_address, )- Parameters
guard (web3.contract.contract.Contract) – Guard contract instance (GuardV0).
gmx_deployment (eth_defi.gmx.whitelist.GMXDeployment) – GMX deployment configuration with router and market addresses.
owner (eth_typing.evm.HexAddress) – Address of the Guard owner (must have permission to whitelist).
safe_address (eth_typing.evm.HexAddress) – Safe address to whitelist as receiver.
- Returns
Dictionary with transaction hashes grouped by operation type.
- Return type