Skip to content

Commit 0b5db3b

Browse files
thelostone-mcmds1zoek1owockioctavioamu
authored
feat: round 7 changes (#7349)
* Add zkSync Checkout (#7314) * Integrate minimal working ETH-only zkSync checkout * Refactor L1 checkout a bit to enable more code re-use with zkSync * Adds full working checkout flow using localstorage, supports ERC20 + ETH * Improve checkout UX by adding modal whehn using zkSync * Warn user before closing or reloading if they started zkSync checkout * Switch to deterministic from ephemeral wallet, fix allowance bug Allowance bug info: If user already had sufficient allowance, tokens were not transferred * Pull out logic into functions to facilitate re-sending on interrupted deposits * zkSync checkout now POSTs to database and shows success message on completion * Handle zkSync checkout interruptions * Fix ESLint errors, add some try/catch blocks * Fix bug in tx validator that prevented testing on rinkeby Also some prep and cleanup for tx validator update * Update tx validator to handle zkSync transfers * Tweak: Show metamask popup on zkSync checkout prompts * Only allow zkSync modal to be closed with a button to prevent accidental closures when checking out * zkSync checkout can now be resumed if interrupted Adds endpoint to look for dropped and replaced transactions to help with this * Various UI/UX updates based on Figma mockups - Update tx processing section of zkSync checkout modal - Update grant detauls page to show Etherscan and zkScan links - Add note about supported L2 account types on new grant page * Update address of batch deposit contract * Reduce gas by only using batch deposit contract when necessary, regular zkSync contract otherwise * Now throws error if user tries to use zkSync checkout with unsupported token * add list view for grants and migrate to vue (#7336) * add list view for grants and migrate to vue * hide idle grants by default * Add contributions on grants * add my grants * Minor fix * Implement follow in vuejs * remove duplicated ids Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com> * fixes gitcoinco/web#7223 * zkSync updates part 2 (#7348) * Checks and validates cart amounts to ensure they are packable * Add support for additional deposits. After donations are complete, all leftover balances are sent to user's web3 address * Update appearance of zkSync modal to match new designs * Add additional checkout flow to support users who already have a zkSync balance * Update detail.js Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com> * updated dates, just in case we got it wrong with db migration * round up fixes * fix for the anonymous user issue * fix up clr info on cards * show contribution button only if user has logged in * update icon * hide browse grants button * rounding issue * reload page on switch type/category * fix grants without round * fix favorite * fix component initialization * eslint fix * fix grant activity * sloppy fix * a few fixes * add pagination * readd stuff * switch btwn rinkeby+mainnet &show sybil info * Fix my grants and add team members (#7354) * Grants Round 7 Trust Bonus Improvements (#7353) * Show SMS on trust bonus page w/ conditional verify button or status * Add placeholder for twitter verification & handle SMS verification via cart link * Conditionally show Trust Bonus banner in cart * Include link in cart trust bonus button + bonus screen touchups * Increase the size of the BrightID QR Code * Fix linting indentation error * fix for loading sidecart * debounce search * remove already loaded scripts * move filter "my grants" * zkSync updates part 3 (#7356) * Update tx validator to support zkSync transfers when user already has funds on L2 * Add loading screen to zkSync modal * Improve gas estimates, recommend checkout approach to user, limit zkSync to 100 contributions * Change zkSync fees to be additive, show which tokens in cart don't support zkSync * Fix so all zksync gas limit estimtes are strings * Bug fixes to cart and tx validator * Update cart copy and add zkSync details to GRANTS.md * Update GRANTS.md * adds grant funding info; per lefteris feedback * adds grant funding info; per lefteris feedback * fix for sms verification * ads trust tab coming soon stuff * stopgap for gitcoinco/web#7131 (comment) * new grants header * zkSync bug fixes (#7368) * Fix zkScan URLs * Ensure default network is mainnet * Impove how tokens are fetched, close zksync modal on 'insufficient balance' errors * Bug fix: prevents users from checking out when donation amounts + fees exceed their L1 wallet balance * matic banner * round 7 integration; adds brightid events to calenndar * udpates img * styles for banners and grid fixes * Additional cart improvements (#7374) * Add gas estimation for approval txs * Fixes for Argent and BN, CSS tweak for mobile * helper script to re-add team members that were removed by gitcoinco/web#7319 * updates grant scripts * adds learn more link * adds brightID info to sybilscore * iexact Co-authored-by: Matt <matt@mattsolomon.dev> Co-authored-by: Miguel Angel Gordián <miguel@gordian.dev> Co-authored-by: owocki <ksowocki@gmail.com> Co-authored-by: octavioamu <octavioamuchastegui@gmail.com> Co-authored-by: Ben DiFrancesco <ben@scopelift.co>
1 parent 55c416b commit 0b5db3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+28625
-810
lines changed

app/app/context.py

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def preprocess(request):
6868
"""Handle inserting pertinent data into the current context."""
6969

7070
# make lbcheck super lightweight
71+
7172
if request.path == '/lbcheck':
7273
return {}
7374

app/app/fixtures/economy.json

+45
Original file line numberDiff line numberDiff line change
@@ -24328,5 +24328,50 @@
2432824328
"metadata": {},
2432924329
"approved": true
2433024330
}
24331+
},
24332+
{
24333+
"model": "economy.token",
24334+
"pk": 363,
24335+
"fields": {
24336+
"created_on": "2020-08-28T00:52:18Z",
24337+
"modified_on": "2020-08-28T01:38:48.009Z",
24338+
"address": "0x3b00ef435fa4fcff5c209a37d1f3dcff37c705ad",
24339+
"symbol": "USDT",
24340+
"network": "rinkeby",
24341+
"decimals": 6,
24342+
"priority": 1,
24343+
"metadata": {},
24344+
"approved": true
24345+
}
24346+
},
24347+
{
24348+
"model": "economy.token",
24349+
"pk": 364,
24350+
"fields": {
24351+
"created_on": "2020-08-28T00:52:18Z",
24352+
"modified_on": "2020-08-28T01:38:48.009Z",
24353+
"address": "0xeb8f08a975ab53e34d8a0330e0d34de942c95926",
24354+
"symbol": "USDC",
24355+
"network": "rinkeby",
24356+
"decimals": 6,
24357+
"priority": 1,
24358+
"metadata": {},
24359+
"approved": true
24360+
}
24361+
},
24362+
{
24363+
"model": "economy.token",
24364+
"pk": 364,
24365+
"fields": {
24366+
"created_on": "2020-08-28T00:52:18Z",
24367+
"modified_on": "2020-08-28T01:38:48.009Z",
24368+
"address": "0x4da8d0795830f75be471f072a034d42c369b5d0a",
24369+
"symbol": "LINK",
24370+
"network": "rinkeby",
24371+
"decimals": 18,
24372+
"priority": 1,
24373+
"metadata": {},
24374+
"approved": true
24375+
}
2433124376
}
2433224377
]

app/assets/v2/css/grants/card.css

+57-2
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,38 @@
99
margin-top: 1.0625rem;
1010
}
1111

12+
.grant-item--list {
13+
padding-bottom: 10px;
14+
}
15+
16+
.grant-item--list:hover {
17+
background-color: #EFEAFD;
18+
}
19+
1220
.flip-card__flipper {
1321
border: 1px solid #D3D3D3;
1422
}
1523

24+
.grant-item--list .grant-item__content {
25+
margin-top: 0.938rem;
26+
}
27+
1628
.grant-item__title {
1729
line-height: 24px;
1830
overflow-y: hidden;
1931
font-weight: bold;
20-
font-size: 1.25rem;
2132
margin-bottom: 15px;
2233
}
2334

2435
.grant-item__title a {
2536
color: #454545;
2637
}
2738

39+
.grant-item--list .grant-item__title {
40+
font-size: 1rem;
41+
margin-bottom: 2px;
42+
}
43+
2844
.grant-item__pitch {
2945
color: #666666;
3046
height: 3.8rem;
@@ -65,6 +81,12 @@
6581
margin: 13px;
6682
}
6783

84+
.grant-item--list .grant-item__img {
85+
height: 3.1rem;
86+
overflow: hidden;
87+
margin: 10px 12px;
88+
}
89+
6890
.grant-item__owner-image,
6991
.flip-card__flipper .grant__stakeholders-item {
7092
height: 35px;
@@ -97,6 +119,11 @@
97119
color: #0D0764;
98120
}
99121

122+
.grant-item--list .grant-item__owner-image {
123+
height: 20px;
124+
width: 20px;
125+
}
126+
100127
.grant-item__funding-label {
101128
color: #BBBDBF;
102129
}
@@ -208,6 +235,34 @@
208235
color: #040404;
209236
}
210237

238+
.match__round--inline {
239+
color: #069953;
240+
}
211241
.clr-prediction .amount {
212242
margin-top: 7px;
213-
}
243+
}
244+
245+
.star-action:hover {
246+
color: var(--gc-blue-hover) !important;
247+
}
248+
249+
@media (max-width: 500px) {
250+
.grant-item--list .grant-item__owner {
251+
align-items: baseline;
252+
display: flex;
253+
flex-direction: column;
254+
}
255+
.grant-item--list .match, .grant-item--list .star-action {
256+
margin-top: 5px !important;
257+
margin-left: 0 !important;
258+
}
259+
260+
.grant-item--list .match {
261+
flex-direction: column;
262+
}
263+
264+
.grant-item--list .grant-action {
265+
padding-top: 5px !important;
266+
padding-bottom: 5px !important;
267+
}
268+
}

app/assets/v2/css/grants/grant.css

+34-7
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@
392392
}
393393

394394
.grants-hero .title-round{
395-
font-size: 24px;
395+
font-size: 24px;
396396
}
397397

398398
.grants-hero .font-header,
@@ -450,7 +450,7 @@
450450
background: transparent !important;
451451
}
452452

453-
#search_form .select2-container {
453+
#top-filters .select2-container, #search_form .select2-container {
454454
width: auto !important;
455455
font-weight: normal;
456456
text-align: left;
@@ -462,22 +462,22 @@
462462

463463
}
464464

465-
#search_form .select2-network-container {
465+
#top-filters .select2-network-container, #search_form .select2-network-container {
466466
width: 5rem !important;
467467
}
468468

469-
#search_form .network-container .select2-container {
469+
#top-filters .select2-container, #search_form .network-container .select2-container {
470470
min-width: 5rem;
471471
}
472472

473-
#search_form .select2-selection {
473+
#top-filters .select2-selection, #search_form .select2-selection {
474474
background: none;
475475
outline: none;
476476
border: none !important;
477477
color: var(--gc-blue);
478478
}
479479

480-
#search_form .select2-selection span {
480+
#top-filters .select2-selection span, #search_form .select2-selection span {
481481
color: #3E00FF;
482482
font-weight: bold;
483483
}
@@ -629,15 +629,32 @@ background: linear-gradient(85.75deg, #03008D -17.8%, #000000 139.56%); /* W3C,
629629
letter-spacing: 2px;
630630
}
631631

632+
.grants_hero_img{
633+
background-position-x: 50%;
634+
background-color: #030118;
635+
}
636+
.grants_hero_img .container{
637+
min-height: 400px;
638+
}
639+
640+
#container_bar{
641+
background-color: #030118;
642+
}
643+
632644
@media (max-width: 991.98px) {
633-
#sidebar_container form#filters {
645+
.grants_hero_img .container{
646+
min-height: 350px;
647+
}
648+
.hide_filters {
634649
height: 0;
635650
display: none;
636651
}
652+
637653
#sidebar_container form#search_form {
638654
display: inline-block;
639655
width: 95%;
640656
}
657+
}
641658

642659
/* sidebar_search.css */
643660

@@ -652,7 +669,17 @@ background: linear-gradient(85.75deg, #03008D -17.8%, #000000 139.56%); /* W3C,
652669
}
653670

654671

672+
@media (max-width: 540px) {
673+
.grants_hero_img .container{
674+
min-height: 220px;
675+
}
676+
}
677+
678+
655679
@media (max-width: 390px) {
680+
.grants_hero_img .container{
681+
min-height: 200px;
682+
}
656683
#search_form .sort_container .select2-container {
657684
width: 200px !important;
658685
}

app/assets/v2/css/sidebar_search.css

-5
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@
9292
}
9393

9494
@media (max-width: 991.98px) {
95-
#sidebar_container form {
96-
height: 0;
97-
display: none;
98-
}
99-
10095
#expand {
10196
display: inherit;
10297
}
Loading
86.8 KB
Loading
+11
Loading

app/assets/v2/js/abi.js

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/v2/js/cart.js

+1,545-148
Large diffs are not rendered by default.

app/assets/v2/js/grants/detail.js

+12-34
Original file line numberDiff line numberDiff line change
@@ -200,40 +200,18 @@ $(document).ready(function() {
200200

201201
$('#cancel_grant').on('click', function(e) {
202202
$('.modal-cancel-grants').on('click', function(e) {
203-
let contract_address = $('#contract_address').val();
204-
let grant_cancel_tx_id;
205-
let deployedSubscription = new web3.eth.Contract(compiledSubscription.abi, contract_address);
206-
207-
web3.eth.getAccounts(function(err, accounts) {
208-
deployedSubscription.methods.endContract()
209-
.send({
210-
from: accounts[0],
211-
gas: 3000000
212-
}).on('transactionHash', function(transactionHash) {
213-
grant_cancel_tx_id = $('#grant_cancel_tx_id').val();
214-
const linkURL = get_etherscan_url(transactionHash);
215-
216-
document.issueURL = linkURL;
217-
$('#transaction_url').attr('href', linkURL);
218-
$('.modal .close').trigger('click');
219-
enableWaitState('#grants-details');
220-
})
221-
.on('confirmation', function(confirmationNumber, receipt) {
222-
$.ajax({
223-
type: 'post',
224-
url: '',
225-
data: {
226-
'contract_address': contract_address,
227-
'grant_cancel_tx_id': grant_cancel_tx_id
228-
},
229-
success: function(json) {
230-
window.location.reload(false);
231-
},
232-
error: function() {
233-
_alert({ message: gettext('Canceling your grant failed to save. Please try again.') }, 'error');
234-
}
235-
});
236-
});
203+
$.ajax({
204+
type: 'post',
205+
url: '',
206+
data: {
207+
'grant_cancel_tx_id': '0x0'
208+
},
209+
success: function(json) {
210+
window.location.reload(false);
211+
},
212+
error: function() {
213+
_alert({ message: gettext('Canceling your grant failed to save. Please try again.') }, 'error');
214+
}
237215
});
238216
});
239217
});

app/assets/v2/js/grants/funding.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -239,19 +239,9 @@ function hideSideCart() {
239239
}
240240

241241
function toggleSideCart() {
242-
$('#grants-details').toggleClass('col-12');
243-
$('#grants-details').toggleClass('col-md-8');
244-
$('#grants-details').toggleClass('col-lg-9');
245-
$('#grants-details').toggleClass('d-none');
246-
$('#grants-details').toggleClass('d-md-block');
242+
$('#grants-details > div').toggleClass('col-12 col-md-8 col-lg-9 d-none d-md-block');
247243

248244
$('#side-cart').toggle();
249-
$('#side-cart').toggleClass('col-12');
250-
$('#side-cart').toggleClass('col-md-4');
251-
$('#side-cart').toggleClass('col-lg-3');
252-
253-
$('#funding-card').toggleClass('mr-md-5');
254-
$('#funding-card').toggleClass('mr-md-3');
255-
$('#funding-card').toggleClass('d-none');
256-
$('#funding-card').toggleClass('d-lg-block');
245+
$('#side-cart').toggleClass('col-12 col-md-4 col-lg-3');
246+
$('#funding-card').toggleClass('mr-md-5 mr-md-3 d-none d-lg-block');
257247
}

0 commit comments

Comments
 (0)