Skip to content

Commit

Permalink
Update Kiiro[KIIRO]
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Aug 14, 2024
1 parent 4057c57 commit a64a430
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 18 deletions.
22 changes: 5 additions & 17 deletions src/Miningcore/Blockchain/Progpow/Custom/Kiiro/KiiroJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,15 @@ Community Fund (10%, 3 KIIRO)

protected override Money CreateFounderOutputs(Transaction tx, Money reward)
{
if (coin.HasFounderFee)
if (founderParameters.Founder != null)
{
Founder[] founders;

if(network.Name.ToLower() == "testnet")
{
founders = new[] { new Founder{ Payee = "TCkC4uoErEyCB4MK3d6ouyJELoXnuyqe9L", Amount = 300000000 }, new Founder{ Payee = "TWDxLLKsFp6qcV1LL4U2uNmW4HwMcapmMU", Amount = 450000000 } };
}
if (founderParameters.Founder.Type == JTokenType.Array)
founders = founderParameters.Founder.ToObject<Founder[]>();
else
{
founders = new[] { new Founder{ Payee = "KDW8CeScVpWFzekvZm4f37qs5GxByEGSKE", Amount = 300000000 }, new Founder{ Payee = "KWTco92wURX5Jwu3mMdWrs36j574meAvew", Amount = 300000000 } };
}

founders = new[] { founderParameters.Founder.ToObject<Founder>() };

foreach(var Founder in founders)
{
if(!string.IsNullOrEmpty(Founder.Payee))
Expand All @@ -179,14 +175,6 @@ protected override Money CreateFounderOutputs(Transaction tx, Money reward)
var payeeReward = Founder.Amount;

tx.Outputs.Add(payeeReward, payeeAddress);

/* A block reward of 30 KIIRO/block is divided as follows:
Miners (20%, 6 KIIRO)
Masternodes (60%, 18 KIIRO)
Development Fund (10%, 3 KIIRO)
Community Fund (10%, 3 KIIRO)
*/
//reward -= payeeReward; // KIIRO does not deduct payeeReward from coinbasevalue (reward) since it's the amount which goes to miners
}
}
Expand Down
27 changes: 26 additions & 1 deletion src/Miningcore/Blockchain/Progpow/ProgpowJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public virtual void Init(BlockTemplate blockTemplate, string jobId,
{
masterNodeParameters = BlockTemplate.Extra.SafeExtensionDataAs<MasterNodeBlockTemplateExtra>();

if(coin.Symbol == "FIRO")
if(coin.Symbol == "FIRO" || coin.Symbol == "KIIRO")
{
if(masterNodeParameters.Extra?.ContainsKey("znode") == true)
{
Expand All @@ -231,7 +231,32 @@ public virtual void Init(BlockTemplate blockTemplate, string jobId,
payeeParameters = BlockTemplate.Extra.SafeExtensionDataAs<PayeeBlockTemplateExtra>();

if (coin.HasFounderFee)
{
founderParameters = BlockTemplate.Extra.SafeExtensionDataAs<FounderBlockTemplateExtra>();
if(coin.HasCommunity)
{
if(founderParameters.Extra?.ContainsKey("community") == true)
{
founderParameters.Founder = JToken.FromObject(founderParameters.Extra["community"]);
}
}

if(coin.HasDeveloper)
{
if(founderParameters.Extra?.ContainsKey("developer") == true)
{
founderParameters.Founder = JToken.FromObject(founderParameters.Extra["developer"]);
}
}

if(coin.HasDataMining)
{
if(founderParameters.Extra?.ContainsKey("datamining") == true)
{
founderParameters.Founder = JToken.FromObject(founderParameters.Extra["datamining"]);
}
}
}

if (coin.HasMinerDevFund)
minerDevFundParameters = BlockTemplate.Extra.SafeExtensionDataAs<MinerDevFundTemplateExtra>("coinbasetxn", "minerdevfund");
Expand Down
9 changes: 9 additions & 0 deletions src/Miningcore/Configuration/ClusterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ public class BitcoinNetworkParams
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasDevFee { get; set; }

[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasCommunity { get; set; }

[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasDeveloper { get; set; }

[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasDataMining { get; set; }

[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasMinerDevFund { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions src/Miningcore/coins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2682,6 +2682,9 @@
]
},
"hasFounderFee": true,
"hasCommunity": true,
"hasDeveloper": true,
"hasDataMining": true,
"hasMasterNodes": true,
"shareMultiplier": 1,
"progpower": "firopow",
Expand Down

0 comments on commit a64a430

Please sign in to comment.