diff --git a/src/config.py b/src/config.py index fba45090..540f4f3e 100644 --- a/src/config.py +++ b/src/config.py @@ -235,6 +235,8 @@ class PaymentConfig: verification_docs_url: str wrapped_native_token_address: ChecksumAddress wrapped_eth_address: Address + min_native_token_transfer: int + min_cow_transfer: int @staticmethod def from_network(network: Network) -> PaymentConfig: @@ -266,6 +268,8 @@ def from_network(network: Network) -> PaymentConfig: wrapped_eth_address = Address( "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" ) + min_native_token_transfer = 1000000000000000 # 0.001 ETH + min_cow_transfer = 20000000000000000000 # 20 COW case Network.GNOSIS: payment_network = EthereumNetwork.GNOSIS @@ -280,6 +284,9 @@ def from_network(network: Network) -> PaymentConfig: wrapped_eth_address = Address( "0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1" ) + min_native_token_transfer = 10000000000000000 # 0.01 xDAI + min_cow_transfer = 1000000000000000000 # 1 COW + case Network.ARBITRUM_ONE: payment_network = EthereumNetwork.ARBITRUM_ONE short_name = "arb1" @@ -293,6 +300,9 @@ def from_network(network: Network) -> PaymentConfig: wrapped_eth_address = Address( "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" ) + min_native_token_transfer = 100000000000000 # 0.0001 ETH + min_cow_transfer = 1000000000000000000 # 1 COW + case Network.BASE: payment_network = EthereumNetwork.BASE_MAINNET short_name = "base" @@ -306,6 +316,9 @@ def from_network(network: Network) -> PaymentConfig: wrapped_eth_address = Address( "0x4200000000000000000000000000000000000006" ) + min_native_token_transfer = 100000000000000 # 0.0001 ETH + min_cow_transfer = 1000000000000000000 # 1 COW + case _: raise ValueError(f"No payment config set up for network {network}.") @@ -321,6 +334,8 @@ def from_network(network: Network) -> PaymentConfig: verification_docs_url=docs_url, wrapped_native_token_address=wrapped_native_token_address, wrapped_eth_address=wrapped_eth_address, + min_native_token_transfer=min_native_token_transfer, + min_cow_transfer=min_cow_transfer, ) diff --git a/src/fetch/transfer_file.py b/src/fetch/transfer_file.py index 1f22e978..e2eda4bd 100644 --- a/src/fetch/transfer_file.py +++ b/src/fetch/transfer_file.py @@ -113,10 +113,12 @@ def auto_propose( def main() -> None: """Generate transfers for an accounting period""" - args = generic_script_init(description="Fetch Complete Reimbursement") - config = AccountingConfig.from_network(Network(os.environ["NETWORK"])) + args = generic_script_init( + description="Fetch Complete Reimbursement", config=config + ) + accounting_period = AccountingPeriod(args.start) orderbook = MultiInstanceDBFetcher( diff --git a/src/utils/script_args.py b/src/utils/script_args.py index 65b1802f..ab3f2a16 100644 --- a/src/utils/script_args.py +++ b/src/utils/script_args.py @@ -3,6 +3,7 @@ import argparse from datetime import date, timedelta from dataclasses import dataclass +from src.config import AccountingConfig @dataclass @@ -17,7 +18,7 @@ class ScriptArgs: ignore_slippage: bool -def generic_script_init(description: str) -> ScriptArgs: +def generic_script_init(description: str, config: AccountingConfig) -> ScriptArgs: """ 1. parses parses command line arguments, 2. establishes dune connection @@ -47,13 +48,13 @@ def generic_script_init(description: str) -> ScriptArgs: "--min-transfer-amount-wei", type=int, help="Ignore ETH transfers with amount less than this", - default=1000000000000000, + default=config.payment_config.min_native_token_transfer, ) parser.add_argument( "--min-transfer-amount-cow-atoms", type=int, help="Ignore COW transfers with amount less than this", - default=20000000000000000000, + default=config.payment_config.min_cow_transfer, ) parser.add_argument( "--ignore-slippage",