ubiquity / ubiquibot

Putting the 'A' in 'DAO'
https://github.com/marketplace/ubiquibot
MIT License
17 stars 60 forks source link

Support Multi Token Rewards #769

Closed rndquu closed 6 months ago

rndquu commented 12 months ago

Original meta issue: https://github.com/ubiquity/ubiquibot/issues/753

Right now we support payouts only in a single token (permit URL example) per a single network (DAI for mainnet + WXDAI for gnosis). We should add support for payouts in multiple tokens so that the following example scenario would be supported:

  1. Bounty hunter solves an issue
  2. Bounty hunter gets rewards in DAI and UBQ on mainnet

What should be done:

  1. Refactor the bot's config so that each reward asset had a unique incentive and payout configuration. Example for DAI and UBQ on mainnet:
    {
    "payouts": [
     {
       "evm-network-id": 1,
       "token-address": "0x6b175474e89094c44da98b954eedeac495271d0f", // DAI
       "price-multiplier": 1,
       "issue-creator-multiplier": 2,
       "payment-permit-max-price": 9007199254740991,
       "assistive-pricing": false, 
       "comment-incentives": false,
       "incentives": {
         "comment": {
           "elements": {},
           "totals": {
             "word": 0
           }
         }
       }
     },
    {
       "evm-network-id": 1,
       "token-address": "0x4e38D89362f7e5db0096CE44ebD021c3962aA9a0", // UBQ
       "price-multiplier": 0.1,
       "issue-creator-multiplier": 0.2,
       "payment-permit-max-price": 9007199254740991,
       "assistive-pricing": false, 
       "comment-incentives": false,
       "incentives": {
         "comment": {
           "elements": {},
           "totals": {
             "word": 0
           }
         }
       }
     }
    ]
    }

So when there are multiple reward tokens set then multiple price labels should be generated. For example, for DAI and UBQ in the config above and Priority: 1 (Normal) with Time: 1 Day the following price labels should be generated: a) Price: 100 DAI b) Price: 10 UBQ

  1. Refactor the permit URL query params (example) and pass base64 encoded array of permits instead of a single one (this is how it works right now)
rndquu commented 6 months ago

Closing it until the new specs are ready https://github.com/ubiquity/ubiquibot/issues/753#issuecomment-1997149917

ubiquibot[bot] commented 6 months ago
# Issue was not closed as completed. Skipping.