Contracts (programs on blockchain) for creating a dutch auction on EVM compatible blockchains.
- LBPPoolFactory
- LBPPool
- Factory Owner
- Pool Owner
- Regular Users
- ProxyAdmin
Allowed Actions:
- Create new LBPPool instances
- Transfer initial token balances to newly created pools
Permissions:
- Can deploy new TransparentUpgradeableProxy contracts
- Can call initialize on new LBPPool instances
- Can transfer tokens from the pool creator to the new pool
Allowed Actions:
- Manage token balances and weights
- Execute swaps between the two pool tokens
- Update weights gradually over time
Permissions:
- Can transfer tokens to and from users during swaps
- Can modify its own state variables (balances, weights, etc.)
Allowed Actions:
- Set new implementation address for LBPPool
- Set new proxy admin address
Permissions:
- Call setImplementation on LBPPoolFactory
- Call setProxyAdmin on LBPPoolFactory
Allowed Actions:
- Set swap fee percentage
- Enable or disable swaps
- Update weights gradually
Permissions:
- Call setSwapFeePercentage on LBPPool
- Call setSwapEnabled on LBPPool
- Call updateWeightsGradually on LBPPool
Allowed Actions:
- Create new pools (if they have sufficient token balances)
- Swap tokens in existing pools
Permissions:
- Call createPool on LBPPoolFactory (requires token approval)
- Call swap on LBPPool instances (requires token approval)
Allowed Actions:
- Upgrade the implementation of LBPPool instances
- Call admin functions on the proxy contracts
Permissions:
- Call upgrade on TransparentUpgradeableProxy instances
- Call changeAdmin on TransparentUpgradeableProxy instances
-
For Pool Creation:
- Users must approve LBPPoolFactory to spend the initial token balances
- Allowance must be at least equal to the initialBalances specified in createPool
-
For Swaps:
- Users must approve LBPPool to spend the token they're swapping in
- Allowance must be at least equal to the amountIn specified in the swap function
- The LBPPoolFactory does not have permission to modify existing pools or their parameters.
- Regular users cannot modify pool parameters (fees, weights, swap enablement).
- The Pool Owner cannot withdraw tokens or change the fundamental structure of the pool.
- The Factory Owner cannot directly interact with or modify individual pools.
- The ProxyAdmin has significant power and should be a secure multisig or governance contract.
- Tiered Permissions: Implement a more granular permission system allowing for different levels of access.
- Time-Locked Operations: Add time locks to sensitive operations like implementation upgrades.
- Governance Integration: Transfer certain permissions to a governance system for more decentralized control.
- Permission Transfers: Allow pool owners to transfer their ownership to another address.
- Emergency Controls: Implement emergency stop functions accessible by a designated guardian.
- Allowance Optimizations: Implement infinite approvals or permit-style functions to reduce transaction costs for frequent traders.
- Factory Permissionlessness: Consider removing the onlyOwner restriction for createPool to allow anyone to create pools.
- Auditing and Transparency: Add events for all permission changes to increase transparency and auditability.