Skip to content

Commit b7598d5

Browse files
committed
Merge remote-tracking branch 'origin/stable'
2 parents 4776e34 + 91621c6 commit b7598d5

File tree

7 files changed

+55
-44
lines changed

7 files changed

+55
-44
lines changed

β€Žapp/app/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,8 @@ def callback(request):
909909

910910
# Match Payouts contract
911911
MATCH_PAYOUTS_ABI = '[ { "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" }, { "internalType": "address", "name": "_funder", "type": "address" }, { "internalType": "contract IERC20", "name": "_dai", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [], "name": "Finalized", "type": "event" }, { "anonymous": false, "inputs": [], "name": "Funded", "type": "event" }, { "anonymous": false, "inputs": [], "name": "FundingWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "PayoutAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "PayoutClaimed", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "_recipient", "type": "address" } ], "name": "claimMatchPayout", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "dai", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "enablePayouts", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "finalize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "funder", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "payouts", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "internalType": "struct MatchPayouts.PayoutFields[]", "name": "_payouts", "type": "tuple[]" } ], "name": "setPayouts", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "state", "outputs": [ { "internalType": "enum MatchPayouts.State", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "withdrawFunding", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ]'
912-
MATCH_PAYOUTS_ADDRESS = '0x3342e3737732d879743f2682a3953a730ae4f47c'
913-
MATCH_PAYOUTS_ROUND_NUM = 9
912+
MATCH_PAYOUTS_ADDRESS = '0x3ebAFfe01513164e638480404c651E885cCA0AA4'
913+
MATCH_PAYOUTS_ROUND_NUM = 10
914914

915915
# BulkCheckout contract
916916
# BulkCheckout parameters

β€Žapp/assets/v2/js/pages/bounty_details2.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ var show_interest_modal = function() {
11361136
_alert({ message: gettext('Please provide an action plan for this ticket. (min 30 chars)') }, 'danger');
11371137
return false;
11381138
}
1139-
1139+
$('#submit').attr('disabled', true);
11401140
add_interest(document.result['pk'], {
11411141
issue_message: msg
11421142
}).then(success => {
@@ -1174,20 +1174,6 @@ var show_interest_modal = function() {
11741174
modals.bootstrapModal('show');
11751175
};
11761176

1177-
// $('body').on('click', '.issue_description img', function() {
1178-
// var content = $.parseHTML(
1179-
// '<div><div class="row"><div class="col-12 closebtn">' +
1180-
// '<a id="" rel="modal:close" href="javascript:void" class="close" aria-label="Close dialog">' +
1181-
// '<span aria-hidden="true">&times;</span>' +
1182-
// '</a>' +
1183-
// '</div>' +
1184-
// '<div class="col-12 pt-2 pb-2"><img class="magnify" src="' + $(this).attr('src') + '"/></div></div></div>');
1185-
1186-
// $(content).appendTo('body').modal({
1187-
// modalClass: 'modal magnify'
1188-
// });
1189-
// });
1190-
11911177
function sleep(ms) {
11921178
return new Promise(resolve => setTimeout(resolve, ms));
11931179
}

β€Žapp/grants/clr.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -443,18 +443,28 @@ def predict_clr(save_to_db=False, from_date=None, clr_round=None, network='mainn
443443
if counter % 10 == 0 or True:
444444
print(f"- {counter}/{total_count} grants iter, pk:{grant.pk}, at {round(time.time(),1)}")
445445

446-
for amount in potential_donations:
447-
# calculate clr with each additional donation and save to grants model
448-
# print(f'using {total_pot_close}')
449-
predicted_clr, grants_clr, _, _ = calculate_clr_for_donation(
450-
grant,
451-
amount,
452-
grant_contributions_curr,
453-
total_pot,
454-
v_threshold,
455-
uv_threshold
456-
)
457-
potential_clr.append(predicted_clr)
446+
if what == 'final':
447+
# this is used when you want to count final distribution and ignore the prediction
448+
for amount in potential_donations:
449+
if amount == 0:
450+
# actual calculation
451+
predicted_clr, grants_clr, _, _ = calculate_clr_for_donation(
452+
grant, amount, grant_contributions_curr, total_pot, v_threshold, uv_threshold
453+
)
454+
else:
455+
# ignore the other ones
456+
predicted_clr = 0.0
457+
grants_clr = None
458+
459+
potential_clr.append(predicted_clr)
460+
else:
461+
for amount in potential_donations:
462+
# calculate clr with each additional donation and save to grants model
463+
# print(f'using {total_pot_close}')
464+
predicted_clr, grants_clr, _, _ = calculate_clr_for_donation(
465+
grant, amount, grant_contributions_curr, total_pot, v_threshold, uv_threshold
466+
)
467+
potential_clr.append(predicted_clr)
458468

459469
if save_to_db:
460470
_grant = Grant.objects.get(pk=grant.pk)

β€Žapp/grants/management/commands/estimate_clr.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from grants.models import GrantCLR
2525
from grants.tasks import process_predict_clr
26-
26+
from grants.clr import predict_clr
2727

2828
class Command(BaseCommand):
2929

@@ -33,6 +33,7 @@ def add_arguments(self, parser):
3333
parser.add_argument('network', type=str, default='mainnet', choices=['rinkeby', 'mainnet'])
3434
parser.add_argument('clr_pk', type=str, default="all")
3535
parser.add_argument('what', type=str, default="full")
36+
parser.add_argument('sync', type=str, default="false")
3637
# slim = just run 0 contribution match upcate calcs
3738
# full, run [0, 1, 10, 100, calcs across all grants]
3839

@@ -42,7 +43,8 @@ def handle(self, *args, **options):
4243
network = options['network']
4344
clr_pk = options['clr_pk']
4445
what = options['what']
45-
print (network, clr_pk, what)
46+
sync = options['sync']
47+
print (network, clr_pk, what, sync)
4648

4749
if clr_pk and clr_pk.isdigit():
4850
active_clr_rounds = GrantCLR.objects.filter(pk=clr_pk)
@@ -51,12 +53,23 @@ def handle(self, *args, **options):
5153

5254
if active_clr_rounds:
5355
for clr_round in active_clr_rounds:
54-
process_predict_clr(
55-
save_to_db=True,
56-
from_date=timezone.now(),
57-
clr_round=clr_round,
58-
network=network,
59-
what=what,
60-
)
56+
if sync == 'true':
57+
# run it sync -> useful for payout / debugging
58+
predict_clr(
59+
save_to_db=True,
60+
from_date=timezone.now(),
61+
clr_round=clr_round,
62+
network=network,
63+
what=what,
64+
)
65+
else:
66+
# runs it as celery task.
67+
process_predict_clr(
68+
save_to_db=True,
69+
from_date=timezone.now(),
70+
clr_round=clr_round,
71+
network=network,
72+
what=what,
73+
)
6174
else:
6275
print("No active CLRs found")

β€Žapp/marketing/mails.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ def grant_more_info_required(grant, more_info):
11261126

11271127

11281128
def grant_match_distribution_test_txn(match):
1129+
raise Exception("no longer supported since we moved to non custodial payouts/email copy needs updated")
11291130
to_email = match.grant.admin_profile.email
11301131
cc_emails = [profile.email for profile in match.grant.team_members.all()]
11311132
from_email = 'kyc@gitcoin.co'
@@ -1203,12 +1204,13 @@ def grant_match_distribution_final_txn(match, needs_claimed=False):
12031204
12041205
What next?
12051206
1. Remember to update your grantees on what you use the funds for by clicking through to your grant ( https://gitcoin.co{match.grant.get_absolute_url()} ) and posting to your activity feed.
1206-
2. Celebrate πŸŽ‰ and consider joining us for KERNEL 3 ( https://kernel.community/ ) as you continue growing your project. πŸ› πŸ› 
1207-
3. Please take a moment to comment on this thread to let us know what you thought of this grants round [https://github.com/gitcoinco/web/issues/8597]. We'd love to hear how the round went for you.
1207+
2. Celebrate πŸŽ‰ and consider joining us for KERNEL 4 ( https://kernel.community/ ) as you continue growing your project. πŸ› πŸ› 
1208+
3. Feel free to grab some Gitcoin schwag at store.gitcoin.co - use code GRANTS_ROUND_10_GRANTEE for 45% off.
1209+
4. Please take a moment to comment on this thread to let us know what you thought of this grants round [https://twitter.com/owocki/status/1410651364850495489]. We'd love to hear how the round went for you.
12081210
12091211
Thanks,
1210-
Team Gitcoin & The Funders League
1211-
"Our mission is to Grow Open Source & provide economic opportunities to software developers" https://gitcoin.co/mission
1212+
Team Gitcoin & The GitcoinDAO
1213+
"Our mission is to build & fund the open web" https://gitcoin.co/mission
12121214
</pre>
12131215
12141216
"""

β€Žscripts/crontab2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
22

33
## CLR
4-
1,30 * * * * cd gitcoin/coin; bash scripts/run_clr.bash slim 2>&1
4+
# 1,30 * * * * cd gitcoin/coin; bash scripts/run_clr.bash slim 2>&1

β€Žscripts/crontab4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
22

33
## CLR
4-
1 */4 * * * cd gitcoin/coin; bash scripts/run_clr.bash full 2>&1
4+
# 1 */4 * * * cd gitcoin/coin; bash scripts/run_clr.bash full 2>&1

0 commit comments

Comments
Β (0)