question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zero dividend error - create_dividend

See original GitHub issue

Occasionally users will complain about getting ‘Zero dividend’ errors when trying to pay out dividends.

Here is an instance of that behavior…

Problem Request

{
	"method": "create_dividend",
	"params": {
		"source": "1BH9sBVQ645gx2D3pfkc95SSvvEXpFhw2N",
		"asset": "PEPEYES",
                "dividend_asset": "STPEPESUNC",
		"quantity_per_unit": 3,
		"fee": 30277,
		"allow_unconfirmed_inputs": true
	},
	"jsonrpc": "2.0",
	"id": 0
}

Problem Details

There are 9 holders of PEPEYES tokens and there are 600 STPEPESUNC tokens issued… so, the dividend SHOULD work and pay out 3 STPEPESUNC to every holder of 1 token of PEPEYES… instead we get a ‘zero dividend’ error returned

https://github.com/CounterpartyXCP/counterparty-lib/blob/765c00b76857d4181bf69a4ddd5b592790073689/counterpartylib/lib/messages/dividend.py#L110

The repo code seems to indicate that 'zero dividend` is thrown when there are no holders, yet clearly there are 9 PEPEYES holders… so what is going on!!!

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jdogresorgcommented, Feb 17, 2021

The issue is your trying to pay out a dividend on VACUZ and there are no holders of VACUZ except the issuer.

image

In order for you to issue dividends, you need to have holders to pay the dividends to. In this case, since you have 0 VACUZ holders (except the issuer), Counterparty is throwing the correct error letting you know that your request would result in zero dividends.

Try again except use an asset that has holders this time 😃

1reaction
chiguireitorcommented, Feb 17, 2021

Think we didn’t rebuild the testnet images, what server were you using?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to correct a #DIV/0! error - Microsoft Support
Microsoft Excel shows the #DIV/0! error when a number is divided by zero (0). It happens when you enter a simple formula like...
Read more >
Catch and handle the ZeroDivisionError - python
Is this a suitable method to divide by zero and get a result - (division by zero not allowed)? Or is there an...
Read more >
Handling divide-by-zero errors - IBM
Dividing by zero is considered an error by the Open Query File (OPNQRYF) command. However, you can get a zero result and avoid...
Read more >
3 Dividend Portfolios That You Can Create
Liquid error: internal initiated a dividend in 2014 and currently yields 1.77% with a payout ratio of 23% based on 2016 earnings estimates...
Read more >
ZeroDivisionError division by zero in Python error handling
In this tutorial, we'll reproduce the issue and then go over some solutions. Reproducing the error#. Let's write the following program, divide.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found