Skip to content

Commit

Permalink
Update Developer payment & Community payment
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Dec 5, 2024
1 parent d308652 commit 0eb9afe
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ protected virtual Money CreateCommunityOutputs(Transaction tx, Money reward)
var payeeReward = Community.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);
//reward -= payeeReward;
reward -= payeeReward;
}
}
}
Expand Down Expand Up @@ -698,7 +698,7 @@ protected virtual Money CreateDeveloperOutputs(Transaction tx, Money reward)
var payeeReward = Developer.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);
//reward -= payeeReward;
reward -= payeeReward;
}
}
}
Expand Down
84 changes: 84 additions & 0 deletions src/Miningcore/Blockchain/Progpow/Custom/Kiiro/KiiroJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,88 @@ Community Fund (9%, 2.7 KIIRO)

#endregion // Masternodes

#region Community

protected override Money CreateCommunityOutputs(Transaction tx, Money reward)
{
if (communityParameters.Community != null)
{
Community[] communitys;
if (communityParameters.Community.Type == JTokenType.Array)
communitys = communityParameters.Community.ToObject<Community[]>();
else
communitys = new[] { communityParameters.Community.ToObject<Community>() };

if(communitys != null)
{
foreach(var Community in communitys)
{
if(!string.IsNullOrEmpty(Community.Script))
{
Script payeeAddress = new (Community.Script.HexToByteArray());
var payeeReward = Community.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);
/* A block reward of 30 KIIRO/block is divided as follows:
Miners (20%, 6 KIIRO)
Masternodes (61%, 18.3 KIIRO)
DataMining Fund (1%, 0.3 KIIRO)
Developer Fund (9%, 2.7 KIIRO)
Community Fund (9%, 2.7 KIIRO)
*/
//reward -= payeeReward; // KIIRO does not deduct payeeReward from coinbasevalue (reward) since it's the amount which goes to miners

}
}
}
}

return reward;
}

#endregion //Community

#region Developer

protected override Money CreateDeveloperOutputs(Transaction tx, Money reward)
{
if (developerParameters.Developer != null)
{
Developer[] developers;
if (developerParameters.Developer.Type == JTokenType.Array)
developers = developerParameters.Developer.ToObject<Developer[]>();
else
developers = new[] { developerParameters.Developer.ToObject<Developer>() };

if(developers != null)
{
foreach(var Developer in developers)
{
if(!string.IsNullOrEmpty(Developer.Script))
{
Script payeeAddress = new (Developer.Script.HexToByteArray());
var payeeReward = Developer.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);
/* A block reward of 30 KIIRO/block is divided as follows:
Miners (20%, 6 KIIRO)
Masternodes (61%, 18.3 KIIRO)
DataMining Fund (1%, 0.3 KIIRO)
Developer Fund (9%, 2.7 KIIRO)
Community Fund (9%, 2.7 KIIRO)
*/
//reward -= payeeReward; // KIIRO does not deduct payeeReward from coinbasevalue (reward) since it's the amount which goes to miners

}
}
}
}

return reward;
}

#endregion //Developer

}
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,87 @@ Community Fund (33%, 1.32 REALI)

#endregion // Masternodes

#region Community

protected override Money CreateCommunityOutputs(Transaction tx, Money reward)
{
if (communityParameters.Community != null)
{
Community[] communitys;
if (communityParameters.Community.Type == JTokenType.Array)
communitys = communityParameters.Community.ToObject<Community[]>();
else
communitys = new[] { communityParameters.Community.ToObject<Community>() };

if(communitys != null)
{
foreach(var Community in communitys)
{
if(!string.IsNullOrEmpty(Community.Script))
{
Script payeeAddress = new (Community.Script.HexToByteArray());
var payeeReward = Community.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);
/* A block reward of 4 REALI/block is divided as follows:
Miners (20%, 0.8 REALI)
Masternodes (37%, 1.48 REALI)
DataMining Fund (2%, 0.08 REALI)
Developer Fund (8%, 0.32 REALI)
Community Fund (33%, 1.32 REALI)
*/
//reward -= payeeReward; // REALI does not deduct payeeReward from coinbasevalue (reward) since it's the amount which goes to miners

}
}
}
}

return reward;
}

#endregion //Community

#region Developer

protected override Money CreateDeveloperOutputs(Transaction tx, Money reward)
{
if (developerParameters.Developer != null)
{
Developer[] developers;
if (developerParameters.Developer.Type == JTokenType.Array)
developers = developerParameters.Developer.ToObject<Developer[]>();
else
developers = new[] { developerParameters.Developer.ToObject<Developer>() };

if(developers != null)
{
foreach(var Developer in developers)
{
if(!string.IsNullOrEmpty(Developer.Script))
{
Script payeeAddress = new (Developer.Script.HexToByteArray());
var payeeReward = Developer.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);
/* A block reward of 4 REALI/block is divided as follows:
Miners (20%, 0.8 REALI)
Masternodes (37%, 1.48 REALI)
DataMining Fund (2%, 0.08 REALI)
Developer Fund (8%, 0.32 REALI)
Community Fund (33%, 1.32 REALI)
*/
//reward -= payeeReward; // REALI does not deduct payeeReward from coinbasevalue (reward) since it's the amount which goes to miners

}
}
}
}

return reward;
}

#endregion //Developer
}

0 comments on commit 0eb9afe

Please sign in to comment.