Skip to content

Commit

Permalink
Preapprove = instant
Browse files Browse the repository at this point in the history
  • Loading branch information
tsarbuig committed Mar 23, 2022
1 parent 56300a9 commit 5213b38
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions LimitSwap.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ def signal_handler(sig, frame):


def timestamp():
timestamp = time()
dt_object = datetime.fromtimestamp(timestamp)
dt_object = datetime.now().strftime('%m-%d %H:%M:%S.%f')
return dt_object


Expand Down Expand Up @@ -2543,6 +2542,10 @@ def check_approval(token, address, allowance_to_compare_with, condition):
printt_info("----------------------------------------------------------------------------------")
printt_info("You have failed to sell tokens --> LimitSwap will check if it needs to be APPROVED")
printt_info("----------------------------------------------------------------------------------")
elif condition == 'instant':
printt_info("----------------------------------------------------------------------------------")
printt_info("You have selected PREAPPROVE = instant --> LimitSwap will now APPROVE this token")
printt_info("----------------------------------------------------------------------------------")
else:
printt_info("-------------------------------------")
printt_info("LimitSwap will now APPROVE this token")
Expand Down Expand Up @@ -5344,6 +5347,10 @@ def run():
# Calculate GAS to use
calculate_gas(token)

# if user has chose the option "instant", token is approved at bot launch.
if settings['PREAPPROVE'] == 'instant':
check_approval(token, token['ADDRESS'], token['_TOKEN_BALANCE'] * token['_CONTRACT_DECIMALS'], 'instant')

# Call of RugDoc API if parameter is set to True
if token['RUGDOC_CHECK'] == 'true':
check_rugdoc_api(token)
Expand Down

0 comments on commit 5213b38

Please sign in to comment.