diff --git a/Frontend/BackgroundServices/PrometheusService.cs b/Frontend/BackgroundServices/PrometheusService.cs index cf94bcafbe5e8de9664070bf6646967e4f7488e7..098fb2c93ae88d219407ac492b8888658e9bf4eb 100644 --- a/Frontend/BackgroundServices/PrometheusService.cs +++ b/Frontend/BackgroundServices/PrometheusService.cs @@ -40,7 +40,7 @@ public class PrometheusService : BackgroundService }; _erc20TokenMetrics.CreateMetrics(); _ethMetrics.CreateMetrics(); - PoolV3Client poolClient = new(chainSettings.Uniswap.RocEthPoolAddress, web3); + PoolV3Client poolClient = new( web3,chainSettings); _poolMetrics.CreateMetrics(poolClient); } diff --git a/Frontend/Functions/SwapExactInputSingleFunction.cs b/Frontend/Functions/SwapExactInputSingleFunction.cs index c729446bd33e8f1ddef57817d38f1987dea6299f..2dd799e9cac0d73adf0010bc2f01b0ac2262d231 100644 --- a/Frontend/Functions/SwapExactInputSingleFunction.cs +++ b/Frontend/Functions/SwapExactInputSingleFunction.cs @@ -4,7 +4,7 @@ using Nethereum.Contracts; using HexBigInteger = Nethereum.Hex.HexTypes.HexBigInteger; namespace Frontend.Functions; - +[Function("swapExactInputSingle", "uint256")] public class SwapExactInputSingleFunction : FunctionMessage { [Parameter("address", "tokenIn", 1)] @@ -23,7 +23,7 @@ public class SwapExactInputSingleFunction : FunctionMessage public string Recipient { get; set; } [Parameter("uint256", "deadline", 6)] - public HexBigInteger Deadline { get; set; } + public BigInteger Deadline { get; set; } [Parameter("uint24", "fee", 7)] public uint Fee { get; set; } diff --git a/Frontend/PoolV3Client.cs b/Frontend/PoolV3Client.cs index 4a7063529c398a01ddcfd25988bed9df425095b8..eddb65dc4aa2f6a5af686f6c73b8a5b3f8bf5fbf 100644 --- a/Frontend/PoolV3Client.cs +++ b/Frontend/PoolV3Client.cs @@ -19,7 +19,7 @@ public class PoolV3Client private string? token1Address = null; private uint? poolFeeTier = null; - public PoolV3Client(string poolAddress, Web3 web3, ChainSettings chainSettings) + public PoolV3Client(Web3 web3, ChainSettings chainSettings) { _pool = web3.Eth.GetContract( @@ -31,7 +31,7 @@ public class PoolV3Client "uniswapV3Pool.abi.json" ) ), - poolAddress + chainSettings.Uniswap.RocEthPoolAddress ); _web3 = web3; _chainSettings = chainSettings; @@ -107,7 +107,7 @@ public class PoolV3Client AmountIn = Web3.Convert.ToWei(amount), AmountOutMinimum = Web3.Convert.ToWei(amountOutMinimum), // Set your minimum amount out Recipient = account.Address, - Deadline = new HexBigInteger(DateTimeOffset.UtcNow.ToUnixTimeSeconds() + 90), // 1:30 minutes from now + Deadline = new BigInteger(DateTimeOffset.UtcNow.ToUnixTimeSeconds() + 90), // 1:30 minutes from now Fee = await getPoolFeeTier(), SqrtPriceLimitX96 = sqrtPriceLimitX96 }; diff --git a/Frontend/Program.cs b/Frontend/Program.cs index f8ec992cc127eb0e11806040e07fda5865768537..e4dc332ff03a762906318a0f30f5cac0021eb652 100644 --- a/Frontend/Program.cs +++ b/Frontend/Program.cs @@ -46,6 +46,8 @@ builder.Services.AddSingleton(provider => new TokenClient( chainId )); +builder.Services.AddSingleton(provider=>account); + builder.Services.AddSingleton(provider => new Web3(account, chainApiUrl)); builder.Services.AddSingleton<PoolMetrics>();