Code Monkey home page Code Monkey logo

auto_renew_bot's Introduction

Auto renew bot

auto_renew_bot's People

Contributors

irisdv avatar th0rgal avatar fricoben avatar

Stargazers

 avatar

Watchers

 avatar  avatar

auto_renew_bot's Issues

bug: crash

Attaching to bot
bot    | INFO: Connected to database
bot    | INFO: Connected to metadata database
bot    | INFO: Started
bot    | INFO: Checking indexer status
bot    | INFO: Indexer is up to date, starting renewals
bot    | [bot] Checking domains to renew
bot    | [bot] checking domains to renew today
bot    | SEVERE: Error while renewing domains: An error occurred while renewing domains: code=-32603, message="Transaction reverted: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:12:
bot    | Got an exception while executing a hint: Hint Error: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Domain already renewed".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | 
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:161)
bot    | Unknown location (pc=0:147)
bot    | 
bot    | Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Domain already renewed".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | " for domains: [FieldElement { inner: 0x0000000000000000000000000000000000000000000000000000000da76be417 }, FieldElement { inner: 0x000000000000000000000000000000000000000000000000000002f78f069e17 }]
bot    | SEVERE: Unable to renew domains: An error occurred while renewing domains: code=-32603, message="Transaction reverted: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:12:
bot    | Got an exception while executing a hint: Hint Error: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Domain already renewed".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | 
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:161)
bot    | Unknown location (pc=0:147)
bot    | 
bot    | Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Domain already renewed".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | "
bot exited with code 0

Extensively test AR + deploy in prod

Testing Tasks

  • Deploy contract on mainnet
  • Deploy contract on testnet
  • Deploy bot on mainnet
  • Deploy bot on testnet
  • Toggle auto renewal for an expired domain
  • Toggle auto renewal for an expiring soon domain
  • Toggle auto renewal for a domain expiring in a long time
  • Toggle auto renewal on a domain paid with taxes
  • Toggle auto renewal for hundreds of expiring domains at once
  • Toggle auto renewal with a too big allowance
  • Toggle auto renewal with a too small allowance
  • Toggle auto renewal but correct allowance but too small balance
  • Toggle auto renewal on a domain I don’t own
  • Toggle auto renewal twice on the same domain (two different users)
  • Disable auto renewal
  • Test auto renewal & referral interaction

Replace limit_prices by domain_prices

Following the audit, the auto renew contract was updated in this pull request.

We now need to specify the domain_price instead of the limit_price (that way if we reduce domain prices, we won't debit more than required to the users). We also need to add support to the new events.

Auto renewal crashes

After enabling auto renewal on a domain called expiresoon.stark, which expired yesterday, the auto_renewal_bot caught it and tried to renew it but produce an error and stopped.

Here is my tx to enable it: https://testnet.starkscan.co/tx/0x3d3502ed61edc17144a0f440a408eddd10c5fc10923955ad1e6afaf70abf783

And the error:

bot    | SEVERE: Error while renewing domains: An error occurred while renewing domains: code=-32603, message="Transaction reverted: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:12:
bot    | Got an exception while executing a hint: Hint Error: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Renewal not toggled for domain".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | 
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:161)
bot    | Unknown location (pc=0:147)
bot    | 
bot    | Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Renewal not toggled for domain".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | " for domains: [FieldElement { inner: 0x0000000000000000000000000000000000000000000000000007da49ab0d47da }]
bot    | SEVERE: Unable to renew domains: An error occurred while renewing domains: code=-32603, message="Transaction reverted: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:12:
bot    | Got an exception while executing a hint: Hint Error: Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Renewal not toggled for domain".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)
bot    | 
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:161)
bot    | Unknown location (pc=0:147)
bot    | 
bot    | Error in the called contract (0x00b325463d0ddca69bb6234cd6fca161b35035f14386b6403a9de208e5a1c71a):
bot    | Error at pc=0:39:
bot    | Got an exception while executing a hint: Hint Error: Execution failed. Failure reason: "Renewal not toggled for domain".
bot    | Cairo traceback (most recent call last):
bot    | Unknown location (pc=0:1398)
bot    | Unknown location (pc=0:1351)
bot    | Unknown location (pc=0:569)
bot    | Error message: argent: multicall 6:6 failed
bot    | Unknown location (pc=0:586)

Also when trying to call the renewal manually, here is what I see:

Image

Automatic renewal bot

The goal of this bot is to detect expiring domain linked to "automatic renewal contract" and renew them automatically. We could have multiple implementations of it. Anyone should be able to run one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.