Skip to content

Commit

Permalink
Add stage 3 developer and community funds
Browse files Browse the repository at this point in the history
  • Loading branch information
JCThePants committed Jun 7, 2022
1 parent 15cc826 commit 7476d59
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
17 changes: 16 additions & 1 deletion libs/class.Coinbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,22 @@ class Coinbase {

_._outputCount = 0;

if (blockTemplate.height < _._chainParams.nSubsidyHalvingFirst) {
const time = mu.now(); // epoch time in seconds

if (time >= _._chainParams.stage3StartTime) {

const coin = _._chainParams.COIN;

const devFundSt = _._chainParams.stage3DevelopmentFund * coin;
const commFundSt = _._chainParams.stage3CommunityFund * coin;

const devFundScript = scripts.makeAddressScript(_._chainParams.stage3DevelopmentFundAddress);
const commFundScript = scripts.makeAddressScript(_._chainParams.stage3CommunityFundAddress);

_._addOutput(outputsArr, devFundSt, devFundScript);
_._addOutput(outputsArr, commFundSt, commFundScript);
}
else if (blockTemplate.height < _._chainParams.nSubsidyHalvingFirst) {

const coin = _._chainParams.COIN;

Expand Down
21 changes: 18 additions & 3 deletions libs/const.ChainParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,36 @@ const ChainParams = {
return {
isTestnet: false,
nSubsidyHalvingFirst: 302438,
COIN: 100000000
COIN: 100000000,
stage3StartTime: 1655380800, // Thursday, 16 June 2022 12:00:00 UTC
stage3DevelopmentFund: 0.9375,
stage3CommunityFund: 0.625,
stage3DevelopmentFundAddress: 'aLgRaYSFk6iVw2FqY1oei8Tdn2aTsGPVmP',
stage3CommunityFundAddress: 'aFA2TbqG9cnhhzX5Yny2pBJRK5EaEqLCH7'
}
},
get TESTNET() {
return {
isTestnet: true,
nSubsidyHalvingFirst: 12000,
COIN: 100000000
COIN: 100000000,
stage3StartTime: 1653409800, // May 24th 2022 04:30 UTC
stage3DevelopmentFund: 0.9375,
stage3CommunityFund: 0.625,
stage3DevelopmentFundAddress: 'TWDxLLKsFp6qcV1LL4U2uNmW4HwMcapmMU',
stage3CommunityFundAddress: 'TCkC4uoErEyCB4MK3d6ouyJELoXnuyqe9L'
}
},
get REGTEST() {
return {
isTestnet: true,
nSubsidyHalvingFirst: 302438,
COIN: 100000000
COIN: 100000000,
stage3StartTime: 2147483647,
stage3DevelopmentFund: 0.9375,
stage3CommunityFund: 0.625,
stage3DevelopmentFundAddress: 'TGEGf26GwyUBE2P2o2beBAfE9Y438dCp5t',
stage3CommunityFundAddress: 'TJmPzeJF4DECrBwUftc265U7rTPxKmpa4F'
}
}
};
Expand Down

0 comments on commit 7476d59

Please sign in to comment.