Skip to content

Commit 55ac746

Browse files
even more gas
1 parent a760aed commit 55ac746

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/flare_ai_defai/blockchain/flare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def create_send_flr_tx(self, to_address: str, amount: float, user: UserInfo) ->
191191
"nonce": self.w3.eth.get_transaction_count(self.wallet_store.get_address(user)),
192192
"to": self.w3.to_checksum_address(to_address),
193193
"value": self.w3.to_wei(amount, unit="ether"),
194-
"gas": 21000,
194+
"gas": 500000,
195195
"maxFeePerGas": self.w3.eth.gas_price,
196196
"maxPriorityFeePerGas": self.w3.eth.max_priority_fee,
197197
"chainId": self.w3.eth.chain_id,
@@ -220,7 +220,7 @@ def create_contract_function_tx(self, user:UserInfo, contract: Contract, functio
220220
tx = function(*args).build_transaction({
221221
"from": self.wallet_store.get_address(user),
222222
"nonce": nonce,
223-
"gas": kwargs.get("gas", 200000),
223+
"gas": kwargs.get("gas", 500000),
224224
"maxFeePerGas": 2*(gas_price + priority_fee),
225225
"maxPriorityFeePerGas": 2*(priority_fee),
226226
"chainId": self.w3.eth.chain_id,

src/flare_ai_defai/blockchain/kinetic_market.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,14 @@ def swapFLRtoSFLR(self, user: UserInfo, amount: float):
223223
# Fetch current nonce
224224
current_nonce = self.w3.eth.get_transaction_count(self.wallet_store.get_address(user))
225225

226-
estimated_gas = self.w3.eth.estimate_gas({
227-
"from": self.wallet_store.get_address(user),
228-
"to": self.SFLR_ADDRESS,
229-
"data": self.SFLR_ABI,
230-
"value": amount_wei,
231-
})
232-
gas_limit = int(estimated_gas * 1.2) # Adding a 20% buffer
226+
#
227+
#estimated_gas = self.w3.eth.estimate_gas({
228+
# "from": self.wallet_store.get_address(user),
229+
# "to": self.SFLR_ADDRESS,
230+
# "data": self.SFLR_ABI,
231+
# "value": amount_wei,
232+
#})
233+
#gas_limit = int(estimated_gas * 1.2) # Adding a 20% buffer
233234

234235
# Create submit transaction with value
235236
tx1 = self.flare_provider.create_contract_function_tx(user,

0 commit comments

Comments
 (0)