From a881e53b349217d29b62c9b12f209d0a5e14a018 Mon Sep 17 00:00:00 2001 From: Chibuotu Amadi Date: Tue, 29 Mar 2022 08:49:12 +0100 Subject: [PATCH 1/3] crosschain cart ui revamp (#10376) * fix eth and extensions * fix qr tabs --- app/grants/templates/grants/cart/eth.html | 10 +- .../grants/cart/eth_checkout_button.html | 6 +- .../templates/grants/cart/eth_polygon.html | 10 +- .../grants/cart/extension/algorand.html | 268 +++++++++------- .../grants/cart/extension/binance.html | 247 +++++++++------ .../grants/cart/extension/harmony.html | 247 +++++++++------ .../grants/cart/extension/kusama.html | 277 +++++++++-------- .../grants/cart/extension/polkadot.html | 277 +++++++++-------- .../templates/grants/cart/extension/rsk.html | 247 +++++++++------ app/grants/templates/grants/cart/qr/celo.html | 289 ++++++++++-------- .../templates/grants/cart/qr/zcash.html | 289 ++++++++++-------- app/grants/templates/grants/cart/qr/zil.html | 288 +++++++++-------- 12 files changed, 1454 insertions(+), 1001 deletions(-) diff --git a/app/grants/templates/grants/cart/eth.html b/app/grants/templates/grants/cart/eth.html index 0bf26962501..3a9734f9d59 100644 --- a/app/grants/templates/grants/cart/eth.html +++ b/app/grants/templates/grants/cart/eth.html @@ -42,7 +42,7 @@ -
+

@@ -80,7 +80,7 @@
-
+
Cannot match own grant
@@ -91,8 +91,7 @@ + 0 DAI - - + estd. match This grant can still receive contributions, but will not receive additional matching funds this round because it has reached the maximum matching cap. - Learn - more + Learn more
diff --git a/app/grants/templates/grants/cart/eth_checkout_button.html b/app/grants/templates/grants/cart/eth_checkout_button.html index 92a4a5e7b45..0a2420cb9ce 100644 --- a/app/grants/templates/grants/cart/eth_checkout_button.html +++ b/app/grants/templates/grants/cart/eth_checkout_button.html @@ -157,10 +157,10 @@ :disabled="activeCheckout !== undefined || grantsUnderMinimalContribution?.length > 0" @click="checkoutWithPolygon(true)" > - Polygon Checkout - + Polygon Checkout + - {% include 'grants/cart/polygon_modal.html' %} + {% include 'grants/cart/polygon_modal.html' %}
diff --git a/app/grants/templates/grants/cart/eth_polygon.html b/app/grants/templates/grants/cart/eth_polygon.html index dbc698cb2ea..0585b970958 100644 --- a/app/grants/templates/grants/cart/eth_polygon.html +++ b/app/grants/templates/grants/cart/eth_polygon.html @@ -42,7 +42,7 @@
-
+

@@ -80,7 +80,7 @@
-
+
Cannot match own grant
@@ -91,8 +91,7 @@ + 0 DAI - - + estd. match This grant can still receive contributions, but will not receive additional matching funds this round because it has reached the maximum matching cap. - Learn - more + Learn more
diff --git a/app/grants/templates/grants/cart/extension/algorand.html b/app/grants/templates/grants/cart/extension/algorand.html index 0b5f4af103c..28570b18bcb 100644 --- a/app/grants/templates/grants/cart/extension/algorand.html +++ b/app/grants/templates/grants/cart/extension/algorand.html @@ -1,128 +1,182 @@ {% load static i18n %} - +

You'll need an Algorand extension to contribute to Algorand grants. We recommend AlgoSigner Wallet.

-
-
- Grant -
-
- Amount -
-
- Total CLR Match Amount -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+
Amount/Currency
+ +
+
-
-
- {% comment %} CLR Match Amount {% endcomment %} -
- Not in an active round -
-
- Cannot match own grant -
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving -
-
- Not Eligible for matching +
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
-
- - Checkout - -
-
- {% comment %} Delete Icon {% endcomment %} - - +
+
- - -
-
- -

- Waiting for confirmation -
- from the wallet... -

-
-
-

- Signing Transaction Failed. -

-

- - Try again in some time -

-
-
-

- Select the account you want to pay from -

- - - -
-
-

- Transaction Submitted! -

- - Grant logo -

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

- -

[[ grant.algorand_payout_address ]]

- -

- You can view the status of your transaction on - here. -

- - Checkout your next Grant + +
+ + [[ grant.grant_donation_currency ]] +
+
+
+
+ +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
+
+
+
+ + Checkout + + +
+
+ +

+ Waiting for confirmation +
+ from the wallet... +

+
+
+

+ Signing Transaction Failed. +

+

+ + Try again in some time +

+
+
+

+ Select the account you want to pay from +

+ +
    +
  • + +
  • +
+
+
+

+ Transaction Submitted! +

+ + Grant logo +

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

+ +

[[ grant.algorand_payout_address ]]

+ +

+ You can view the status of your transaction on + here. +

+ + Checkout your next Grant +
+
+
+
+ +
+ +
+ +
+ +
+
- +
+ +
diff --git a/app/grants/templates/grants/cart/extension/binance.html b/app/grants/templates/grants/cart/extension/binance.html index 151afd35c02..82b7207d096 100644 --- a/app/grants/templates/grants/cart/extension/binance.html +++ b/app/grants/templates/grants/cart/extension/binance.html @@ -7,103 +7,174 @@ Binance Chain Extension Wallet.

-
-
- Grant -
-
- Amount -
-
- Total CLR Match Amount -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+
Amount/Currency
+ +
+
-
-
- {% comment %} CLR Match Amount {% endcomment %} -
- Not in an active round -
-
- Cannot match own grant -
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving -
-
- Not Eligible for matching +
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
-
- - Checkout - -
-
- {% comment %} Delete Icon {% endcomment %} - - +
+
- - -
-
- -

- Waiting for confirmation -
- from the wallet... -

-
-
-

- Signing Transaction Failed. -

- - Try again in some time -

-
-
-

- Transaction Submitted! -

- - Grant logo -

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

- -

[[ grant.binance_payout_address ]]

- -

- You can view the status of your transaction on - here. -

- - Checkout your next Grant + +
+
+
+ +
+
+
+ Grant logo +
+
+

+ [[grant.grant_title]] +

+ +
+ + [[ grant.grant_donation_currency ]] +
+
+
+
+ +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
+
+
+
+ + Checkout + + +
+
+ +

+ Waiting for confirmation +
+ from the wallet... +

+
+
+

+ Signing Transaction Failed. +

+

+ + Try again in some time +

+
+
+

+ Select the account you want to pay from +

+ +
    +
  • + +
  • +
+
+
+

+ Transaction Submitted! +

+ + Grant logo +

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

+ +

[[ grant.binance_payout_address ]]

+ +

+ You can view the status of your transaction on + here. +

+ + Checkout your next Grant +
+
+
+
+ +
+ +
+ +
+ +
+
- +
+ +
diff --git a/app/grants/templates/grants/cart/extension/harmony.html b/app/grants/templates/grants/cart/extension/harmony.html index 2b2478ffd8c..5bfab8083fe 100644 --- a/app/grants/templates/grants/cart/extension/harmony.html +++ b/app/grants/templates/grants/cart/extension/harmony.html @@ -7,103 +7,174 @@ Harmony ONE Wallet.

-
-
- Grant -
-
- Amount -
-
- Total CLR Match Amount -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+
Amount/Currency
+ +
+
-
-
- {% comment %} CLR Match Amount {% endcomment %} -
- Not in an active round -
-
- Cannot match own grant -
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving -
-
- Not Eligible for matching +
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
-
- - Checkout - -
-
- {% comment %} Delete Icon {% endcomment %} - - +
+
- - -
-
- -

- Waiting for confirmation -
- from the wallet... -

-
-
-

- Signing Transaction Failed. -

- - Try again in some time -

-
-
-

- Transaction Submitted! -

- - Grant logo -

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

- -

[[ grant.harmony_payout_address ]]

- -

- You can view the status of your transaction on - here. -

- - Checkout your next Grant + +
+
+
+ +
+
+
+ Grant logo +
+
+

+ [[grant.grant_title]] +

+ +
+ + [[ grant.grant_donation_currency ]] +
+
+
+
+ +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
+
+
+
+ + Checkout + + +
+
+ +

+ Waiting for confirmation +
+ from the wallet... +

+
+
+

+ Signing Transaction Failed. +

+

+ + Try again in some time +

+
+
+

+ Select the account you want to pay from +

+ +
    +
  • + +
  • +
+
+
+

+ Transaction Submitted! +

+ + Grant logo +

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

+ +

[[ grant.harmony_payout_address ]]

+ +

+ You can view the status of your transaction on + here. +

+ + Checkout your next Grant +
+
+
+
+ +
+ +
+ +
+ +
+
- +
+ +
diff --git a/app/grants/templates/grants/cart/extension/kusama.html b/app/grants/templates/grants/cart/extension/kusama.html index 68bd98ac797..8077beddda5 100644 --- a/app/grants/templates/grants/cart/extension/kusama.html +++ b/app/grants/templates/grants/cart/extension/kusama.html @@ -7,135 +7,174 @@ Polkadot{.js} extension.

-
-
- Grant -
-
- Amount -
-
- Total CLR Match Amount -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+
Amount/Currency
+ +
+
-
-
- {% comment %} CLR Match Amount {% endcomment %} -
- Not in an active round -
-
- Cannot match own grant -
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving -
-
- Not Eligible for matching +
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
-
- - Checkout - -
-
- {% comment %} Delete Icon {% endcomment %} - - +
+
- - -
-
- -

- Waiting for confirmation -
- from the wallet... -

-
-
-

- Signing Transaction Failed. -

-

- - Try again in some time -

-
-
-

- Select the account you want to pay from -

- -
    -
  • - -
  • -
- -
-
-

- Transaction Submitted! -

- - Grant logo -

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

- -

[[ grant.kusama_payout_address ]]

- -

- You can view the status of your transaction on - here. -

- - Checkout your next Grant + +
+ + [[ grant.grant_donation_currency ]] +
+
+
+
+ +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
+
+
+
+ + Checkout + + +
+
+ +

+ Waiting for confirmation +
+ from the wallet... +

+
+
+

+ Signing Transaction Failed. +

+

+ + Try again in some time +

+
+
+

+ Select the account you want to pay from +

+ +
    +
  • + +
  • +
+
+
+

+ Transaction Submitted! +

+ + Grant logo +

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

+ +

[[ grant.kusama_payout_address ]]

+ +

+ You can view the status of your transaction on + here. +

+ + Checkout your next Grant +
+
+
+
+ +
+ +
+ +
+ +
+
- +
+ +
diff --git a/app/grants/templates/grants/cart/extension/polkadot.html b/app/grants/templates/grants/cart/extension/polkadot.html index 3ceb8f330ff..a1f6f9f2a64 100644 --- a/app/grants/templates/grants/cart/extension/polkadot.html +++ b/app/grants/templates/grants/cart/extension/polkadot.html @@ -7,135 +7,174 @@ Polkadot{.js} extension.

-
-
- Grant -
-
- Amount -
-
- Total CLR Match Amount -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+
Amount/Currency
+ +
+
-
-
- {% comment %} CLR Match Amount {% endcomment %} -
- Not in an active round -
-
- Cannot match own grant -
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving -
-
- Not Eligible for matching +
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
-
- - Checkout - -
-
- {% comment %} Delete Icon {% endcomment %} - - +
+
- - -
-
- -

- Waiting for confirmation -
- from the wallet... -

-
-
-

- Signing Transaction Failed. -

-

- - Try again in some time -

-
-
-

- Select the account you want to pay from -

- -
    -
  • - -
  • -
- -
-
-

- Transaction Submitted! -

- - Grant logo -

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

- -

[[ grant.polkadot_payout_address ]]

- -

- You can view the status of your transaction on - here. -

- - Checkout your next Grant + +
+ + [[ grant.grant_donation_currency ]] +
+
+
+
+ +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
+
+
+
+ + Checkout + + +
+
+ +

+ Waiting for confirmation +
+ from the wallet... +

+
+
+

+ Signing Transaction Failed. +

+

+ + Try again in some time +

+
+
+

+ Select the account you want to pay from +

+ +
    +
  • + +
  • +
+
+
+

+ Transaction Submitted! +

+ + Grant logo +

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

+ +

[[ grant.polkadot_payout_address ]]

+ +

+ You can view the status of your transaction on + here. +

+ + Checkout your next Grant +
+
+
+
+ +
+ +
+ +
+ +
+
- +
+ +
diff --git a/app/grants/templates/grants/cart/extension/rsk.html b/app/grants/templates/grants/cart/extension/rsk.html index ffe2b75b5c2..fe7349407a5 100644 --- a/app/grants/templates/grants/cart/extension/rsk.html +++ b/app/grants/templates/grants/cart/extension/rsk.html @@ -7,103 +7,174 @@ Nifty Wallet.

-
-
- Grant -
-
- Amount -
-
- Total CLR Match Amount -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+
Amount/Currency
+ +
+
-
-
- {% comment %} CLR Match Amount {% endcomment %} -
- Not in an active round -
-
- Cannot match own grant -
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving -
-
- Not Eligible for matching +
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
-
- - Checkout - -
-
- {% comment %} Delete Icon {% endcomment %} - - +
+
- - -
-
- -

- Waiting for confirmation -
- from the wallet... -

-
-
-

- Signing Transaction Failed. -

- - Try again in some time -

-
-
-

- Transaction Submitted! -

- - Grant logo -

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

- -

[[ grant.rsk_payout_address ]]

- -

- You can view the status of your transaction on - here. -

- - Checkout your next Grant + +
+
+
+ +
+
+
+ Grant logo +
+
+

+ [[grant.grant_title]] +

+ +
+ + [[ grant.grant_donation_currency ]] +
+
+
+
+ +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
+
+
+
+ + Checkout + + +
+
+ +

+ Waiting for confirmation +
+ from the wallet... +

+
+
+

+ Signing Transaction Failed. +

+

+ + Try again in some time +

+
+
+

+ Select the account you want to pay from +

+ +
    +
  • + +
  • +
+
+
+

+ Transaction Submitted! +

+ + Grant logo +

[[grant.grant_title]] ([[grant.grant_donation_amount]] [[grant.grant_donation_currency]])

+ +

[[ grant.rsk_payout_address ]]

+ +

+ You can view the status of your transaction on + here. +

+ + Checkout your next Grant +
+
+
+
+ +
+ +
+ +
+ +
+
- +
+ +
diff --git a/app/grants/templates/grants/cart/qr/celo.html b/app/grants/templates/grants/cart/qr/celo.html index 292d61fecc8..fac8b518882 100644 --- a/app/grants/templates/grants/cart/qr/celo.html +++ b/app/grants/templates/grants/cart/qr/celo.html @@ -2,151 +2,188 @@ -
-
- Grant -
-
- Amount +
+ +
+ +
+
Amount/Currency
+ +
+ + + +
+
+
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
+
-
- Total CLR Match Amount +
+
-
-
-
-
- {% comment %} Title and logo {% endcomment %} - - {% comment %} Grant amount and currency {% endcomment %} -
-
- - - - - - + +
+
+
+ +
+
+
+ Grant logo +
+
+

+ [[grant.grant_title]] +

+ +
+ + [[ grant.grant_donation_currency ]] +
+
+
- +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
-
--> -
- - {% comment %} CLR Match Amount {% endcomment %} - -
-
- Not in an active round
-
- Cannot match own grant +
+ + Open to Pay + + + + + Completed + + +
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving + +
+
-
- Not Eligible for matching + +
+
-
- -
- - Payout - - - - - Completed - - - -
- {% comment %} Delete Icon {% endcomment %} -
- - -
-
-
- -
- -
-
-

Step 1: Transfer [[grant.grant_donation_amount]] [[grant.grant_donation_currency]] to the grant owner’s address below. Make sure you’re transferring the EXACT SAME AMOUNT shown here or your transaction will not be detected.

- -
- -
-
- To: -
- [[grant.celo_payout_address]] - -
+ + + +
+
+

Step 1: Transfer [[grant.grant_donation_amount]] [[grant.grant_donation_currency]] to the grant owner's address below. Make sure you're transferring the EXACT SAME AMOUNT shown here or your transaction will not be detected.

+ +
+
+
-
- Amount: -
- [[grant.grant_donation_amount]] +
+
+ To: +
+ [[grant.celo_payout_address]] + +
+
+
+ Amount: +
+ [[grant.grant_donation_amount]] +
-
-
-
-

Step 2: Choose between address or transaction hash and press the confirm button.

- - - - -
-
-
- - - Paste the transaction id +
+

Step 2: Choose between address or transaction hash and press the confirm button.

+ + + + +
+
+
+ + + Paste the transaction id +
-
-
-
- - +
+
+ + +
+
+
+
-
- -
+
[[grant.error]]
+
[[grant.success]]
-
[[grant.error]]
-
[[grant.success]]
-
- - - + + + +
+
+ +
diff --git a/app/grants/templates/grants/cart/qr/zcash.html b/app/grants/templates/grants/cart/qr/zcash.html index 80c0fb5dc25..25314141bc8 100644 --- a/app/grants/templates/grants/cart/qr/zcash.html +++ b/app/grants/templates/grants/cart/qr/zcash.html @@ -2,151 +2,188 @@ -
-
- Grant -
-
- Amount +
+ +
+ +
+
Amount/Currency
+ +
+ + + +
+
+
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
+
-
- Total CLR Match Amount +
+
-
-
-
-
- {% comment %} Title and logo {% endcomment %} - - {% comment %} Grant amount and currency {% endcomment %} -
-
- - - - - - + +
+
+
+ +
+
+
+ Grant logo +
+
+

+ [[grant.grant_title]] +

+ +
+ + [[ grant.grant_donation_currency ]] +
+
+
- +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
-
--> -
- - {% comment %} CLR Match Amount {% endcomment %} - -
-
- Not in an active round
-
- Cannot match own grant +
+ + Open to Pay + + + + + Completed + + +
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving + +
+
-
- Not Eligible for matching + +
+
-
-
- - Payout - - - - - Completed - - - -
- {% comment %} Delete Icon {% endcomment %} -
- - -
-
-
- -
- -
-
-

Step 1: Transfer [[grant.grant_donation_amount]] [[grant.grant_donation_currency]] to the grant owner’s address below. Make sure you’re transferring the EXACT SAME AMOUNT shown here or your transaction will not be detected.

- -
- -
-
- To: -
- [[grant.zcash_payout_address]] - -
+ + + +
+
+

Step 1: Transfer [[grant.grant_donation_amount]] [[grant.grant_donation_currency]] to the grant owner's address below. Make sure you're transferring the EXACT SAME AMOUNT shown here or your transaction will not be detected.

+ +
+
+
-
- Amount: -
- [[grant.grant_donation_amount]] +
+
+ To: +
+ [[grant.zcash_payout_address]] + +
+
+
+ Amount: +
+ [[grant.grant_donation_amount]] +
-
-
-
-

Step 2: Choose between t-address or transaction hash and press the confirm button.

- - - - -
-
-
- - - Paste the transaction id +
+

Step 2: Choose between address or transaction hash and press the confirm button.

+ + + + +
+
+
+ + + Paste the transaction id +
-
-
-
- - - Only t-address are allowed (no z-address support) +
+
+ + +
+
+
+
-
- -
+
[[grant.error]]
+
[[grant.success]]
-
[[grant.error]]
-
[[grant.success]]
-
- - - + + + +
+
+ +
diff --git a/app/grants/templates/grants/cart/qr/zil.html b/app/grants/templates/grants/cart/qr/zil.html index 8e5749a7b68..47ba823d3b4 100644 --- a/app/grants/templates/grants/cart/qr/zil.html +++ b/app/grants/templates/grants/cart/qr/zil.html @@ -2,150 +2,188 @@ -
-
- Grant -
-
- Amount +
+ +
+ +
+
Amount/Currency
+ +
+ + + +
+
+
+ Apply to all + +
+
+ + Save to Collection +
+ +
+ +
+
+
-
- Total CLR Match Amount +
+
-
-
-
-
- {% comment %} Title and logo {% endcomment %} - - {% comment %} Grant amount and currency {% endcomment %} -
-
- - - - - - + +
+
+
+ +
+
+
+ Grant logo +
+
+

+ [[grant.grant_title]] +

+ +
+ + [[ grant.grant_donation_currency ]] +
+
+
- +
+ +
Cannot match own grant
+
+ + + [[grant.grant_donation_clr_match]] DAI + + + + 0 DAI + + + estd. match + + +
+ This grant can still receive contributions, but will not receive additional matching funds this + round because it has reached the maximum matching cap. + Learn more +
+
+
-
--> -
- - {% comment %} CLR Match Amount {% endcomment %} - -
-
- Not in an active round
-
- Cannot match own grant +
+ + Open to Pay + + + + + Completed + + +
-
-
[[grant.grant_donation_clr_match]] USD
- Diamonds high-fiving + +
+
-
- Not Eligible for matching + +
+
-
-
- - Payout - - - - - Completed - - - -
- {% comment %} Delete Icon {% endcomment %} -
- - -
-
-
- -
- -
-
-

Step 1: Transfer [[grant.grant_donation_amount]] [[grant.grant_donation_currency]] to the grant owner’s address below. Make sure you’re transferring the EXACT SAME AMOUNT shown here or your transaction will not be detected.

- -
- -
-
- To: -
- [[grant.zil_payout_address]] - -
+ + + +
+
+

Step 1: Transfer [[grant.grant_donation_amount]] [[grant.grant_donation_currency]] to the grant owner's address below. Make sure you're transferring the EXACT SAME AMOUNT shown here or your transaction will not be detected.

+ +
+
+
-
- Amount: -
- [[grant.grant_donation_amount]] +
+
+ To: +
+ [[grant.zil_payout_address]] + +
+
+
+ Amount: +
+ [[grant.grant_donation_amount]] +
-
-
-
-

Step 2: Choose between address or transaction hash and press the confirm button.

- - - - -
-
-
- - - Paste the transaction id +
+

Step 2: Choose between address or transaction hash and press the confirm button.

+ + + + +
+
+
+ + + Paste the transaction id +
-
-
-
- - +
+
+ + +
+
+
+
-
- -
+
[[grant.error]]
+
[[grant.success]]
-
[[grant.error]]
-
[[grant.success]]
-
- - - + + + +
+
+ +
From 53837f9528250ae4f420141c9d2b6dd61a38b14b Mon Sep 17 00:00:00 2001 From: Chibuotu Amadi Date: Fri, 1 Apr 2022 13:43:07 +0100 Subject: [PATCH 2/3] fix https://github.com/gitcoinco/web/commit/539598eb676d8134b40a8abf2999f5c935d76e9d (#10431) --- app/dashboard/notifications.py | 3 +-- app/grants/models/contribution.py | 18 +++++++----------- app/marketing/common/earnings.py | 2 +- .../commands/bounty_feedback_email.py | 2 +- .../commands/send_quarterly_stats.py | 2 +- app/marketing/management/commands/sync_mail.py | 2 +- .../commands/unsubscribe_daily_emails.py | 2 +- app/marketing/tasks.py | 6 +++--- .../tasks/test_export_earnings_to_csv_task.py | 2 +- app/marketing/tests/test_marketing_utils.py | 2 +- app/marketing/views.py | 2 +- app/retail/emails.py | 2 +- app/tdi/views.py | 2 +- scripts/debug/output_weekly_mailing_list.py | 2 +- 14 files changed, 22 insertions(+), 27 deletions(-) diff --git a/app/dashboard/notifications.py b/app/dashboard/notifications.py index 87a4064ed46..df284cc543d 100644 --- a/app/dashboard/notifications.py +++ b/app/dashboard/notifications.py @@ -31,10 +31,9 @@ import twitter from economy.utils import convert_token_to_usdt from git.utils import delete_issue_comment, org_name, patch_issue_comment, post_issue_comment, repo_name +from marketing.common.utils import allowed_to_send_email from marketing.mails import featured_funded_bounty, send_mail, setup_lang, tip_email from marketing.models import GithubOrgToTwitterHandleMapping -from marketing.common.utils import allowed_to_send_email - from pyshorteners import Shortener from retail.emails import render_new_kudos_email from slackclient import SlackClient diff --git a/app/grants/models/contribution.py b/app/grants/models/contribution.py index 40eee6eb496..842fe5bfc40 100644 --- a/app/grants/models/contribution.py +++ b/app/grants/models/contribution.py @@ -1,3 +1,5 @@ +from datetime import timedelta + from django.conf import settings from django.contrib.postgres.fields import JSONField from django.db import models @@ -7,8 +9,6 @@ from django.utils.translation import gettext_lazy as _ import requests -from datetime import timedelta - from economy.models import SuperModel, Token from economy.tx import check_for_replaced_tx from townsquare.models import Comment @@ -180,17 +180,13 @@ def leave_gitcoinbot_comment_for_status(self, status): comment = f"Transaction status: {status} (as of {timezone.now().strftime('%Y-%m-%d %H:%m %Z')})" profile = Profile.objects.get(handle='gitcoinbot') activity = self.subscription.activities.first() - # delete all before recreating - Comment.objects.filter( + Comment.objects.update_or_create( profile=profile, activity=activity, - ).delete() - # create new entry - Comment.objects.create( - profile=profile, - activity=activity, - comment=comment, - is_edited=True + defaults={ + "comment": comment, + "is_edited": True, + } ) except Exception as e: print(e) diff --git a/app/marketing/common/earnings.py b/app/marketing/common/earnings.py index 10cae5d73f0..676827ade56 100644 --- a/app/marketing/common/earnings.py +++ b/app/marketing/common/earnings.py @@ -1,5 +1,5 @@ -import io import csv +import io import logging from django.conf import settings diff --git a/app/marketing/management/commands/bounty_feedback_email.py b/app/marketing/management/commands/bounty_feedback_email.py index 17849f27fee..c10fbd088a7 100644 --- a/app/marketing/management/commands/bounty_feedback_email.py +++ b/app/marketing/management/commands/bounty_feedback_email.py @@ -20,8 +20,8 @@ from django.utils import timezone from dashboard.models import Bounty -from marketing.mails import bounty_feedback from marketing.common.utils import handle_bounty_feedback +from marketing.mails import bounty_feedback class Command(BaseCommand): diff --git a/app/marketing/management/commands/send_quarterly_stats.py b/app/marketing/management/commands/send_quarterly_stats.py index 053fce0fb92..2c27cec9a2b 100644 --- a/app/marketing/management/commands/send_quarterly_stats.py +++ b/app/marketing/management/commands/send_quarterly_stats.py @@ -21,9 +21,9 @@ from django.core.management.base import BaseCommand from dashboard.models import Profile +from marketing.common.utils import get_platform_wide_stats from marketing.mails import quarterly_stats from marketing.models import LeaderboardRank -from marketing.common.utils import get_platform_wide_stats warnings.filterwarnings("ignore", category=DeprecationWarning) diff --git a/app/marketing/management/commands/sync_mail.py b/app/marketing/management/commands/sync_mail.py index 19a50f853ea..5ce95b6ab09 100644 --- a/app/marketing/management/commands/sync_mail.py +++ b/app/marketing/management/commands/sync_mail.py @@ -20,8 +20,8 @@ from django.utils import timezone from mailchimp3 import MailChimp -from marketing.models import EmailSubscriber from marketing.common.utils import get_or_save_email_subscriber as process_email +from marketing.models import EmailSubscriber hours_ago = 12 #if you change, this make sure you change the crontab file to ... # make it inclusive of all users since last run of this job diff --git a/app/marketing/management/commands/unsubscribe_daily_emails.py b/app/marketing/management/commands/unsubscribe_daily_emails.py index 0bfb074e7f4..a556a0fa6f5 100644 --- a/app/marketing/management/commands/unsubscribe_daily_emails.py +++ b/app/marketing/management/commands/unsubscribe_daily_emails.py @@ -23,9 +23,9 @@ from django.core.management.base import BaseCommand from django.utils import timezone +from marketing.common.utils import allowed_to_send_email from marketing.mails import gdpr_reconsent from marketing.models import EmailEvent, EmailSubscriber -from marketing.common.utils import allowed_to_send_email warnings.filterwarnings("ignore", category=DeprecationWarning) diff --git a/app/marketing/tasks.py b/app/marketing/tasks.py index 1b6360f1660..b51ffda06b0 100644 --- a/app/marketing/tasks.py +++ b/app/marketing/tasks.py @@ -1,6 +1,6 @@ import csv -import os import io +import os from django.conf import settings from django.contrib.auth.models import User @@ -10,11 +10,11 @@ from app.services import RedisService from celery import app from celery.utils.log import get_task_logger +from marketing.common.earnings import export_earnings, send_csv, send_download_failure_email +from marketing.common.utils import allowed_to_send_email from marketing.mails import new_bounty_daily as new_bounty_daily_email from marketing.mails import weekly_roundup as weekly_roundup_email from marketing.models import EmailSubscriber -from marketing.common.utils import allowed_to_send_email -from marketing.common.earnings import export_earnings, send_csv, send_download_failure_email logger = get_task_logger(__name__) diff --git a/app/marketing/tests/tasks/test_export_earnings_to_csv_task.py b/app/marketing/tests/tasks/test_export_earnings_to_csv_task.py index 5e21bf41481..97a94bef5f7 100644 --- a/app/marketing/tests/tasks/test_export_earnings_to_csv_task.py +++ b/app/marketing/tests/tasks/test_export_earnings_to_csv_task.py @@ -29,8 +29,8 @@ from celery.exceptions import MaxRetriesExceededError from dashboard.tests.factories import EarningFactory, ProfileFactory from grants.tests.factories import GrantFactory -from marketing.tasks import send_earnings_csv from marketing.common.earnings import export_earnings, send_csv +from marketing.tasks import send_earnings_csv @pytest.fixture diff --git a/app/marketing/tests/test_marketing_utils.py b/app/marketing/tests/test_marketing_utils.py index a7339ffceba..59732a0acd1 100644 --- a/app/marketing/tests/test_marketing_utils.py +++ b/app/marketing/tests/test_marketing_utils.py @@ -17,8 +17,8 @@ along with this program. If not, see . """ -from marketing.models import EmailSubscriber, Stat from marketing.common.utils import allowed_to_send_email, func_name, get_or_save_email_subscriber, get_stat +from marketing.models import EmailSubscriber, Stat from test_plus.test import TestCase diff --git a/app/marketing/views.py b/app/marketing/views.py index 9efc32d86c0..6003cb21b8f 100644 --- a/app/marketing/views.py +++ b/app/marketing/views.py @@ -44,11 +44,11 @@ from gas.utils import recommend_min_gas_price_to_confirm_in_time from git.utils import get_github_primary_email from grants.models import Grant +from marketing.common.utils import delete_email_subscription, get_or_save_email_subscriber, validate_slack_integration from marketing.country_codes import COUNTRY_CODES, COUNTRY_NAMES, FLAG_API_LINK, FLAG_ERR_MSG, FLAG_SIZE, FLAG_STYLE from marketing.mails import new_feedback from marketing.models import AccountDeletionRequest, EmailSubscriber, Keyword, LeaderboardRank, UpcomingDate from marketing.tasks import send_earnings_csv -from marketing.common.utils import delete_email_subscription, get_or_save_email_subscriber, validate_slack_integration from retail.emails import render_new_bounty from retail.helpers import get_ip from townsquare.models import Announcement diff --git a/app/retail/emails.py b/app/retail/emails.py index 204f36c8c33..15a343bfe1c 100644 --- a/app/retail/emails.py +++ b/app/retail/emails.py @@ -36,8 +36,8 @@ import premailer from app.utils import get_default_network from grants.models import Contribution, Grant, Subscription -from marketing.models import LeaderboardRank from marketing.common.utils import get_or_save_email_subscriber +from marketing.models import LeaderboardRank from perftools.models import StaticJsonEnv from retail.utils import build_utm_tracking, strip_double_chars, strip_html diff --git a/app/tdi/views.py b/app/tdi/views.py index 057c55a06e3..91e3d312d87 100644 --- a/app/tdi/views.py +++ b/app/tdi/views.py @@ -32,8 +32,8 @@ from django.utils.translation import gettext from django.utils.translation import gettext_lazy as _ -from marketing.mails import send_mail, setup_lang from marketing.common.utils import invite_to_slack +from marketing.mails import send_mail, setup_lang from PyPDF2 import PdfFileReader, PdfFileWriter from ratelimit.decorators import ratelimit from reportlab.lib.colors import Color diff --git a/scripts/debug/output_weekly_mailing_list.py b/scripts/debug/output_weekly_mailing_list.py index fda138ee1a8..5deed1de4ba 100644 --- a/scripts/debug/output_weekly_mailing_list.py +++ b/scripts/debug/output_weekly_mailing_list.py @@ -1,8 +1,8 @@ f = open("output.csv", "w") import time -from marketing.models import EmailSubscriber from marketing.common.utils import allowed_to_send_email, func_name, get_or_save_email_subscriber +from marketing.models import EmailSubscriber queryset = EmailSubscriber.objects.all() count = queryset.count() From 8db185dfebb59fadf9da97c99cc28c9264719700 Mon Sep 17 00:00:00 2001 From: nutrina Date: Mon, 4 Apr 2022 10:17:48 +0300 Subject: [PATCH 3/3] Implementation to use Metamask for bounty payouts on Harmony (#10430) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [10428] Implementation to use Metamask for bounty payouts on Harmony * [#10428] Continue with adding support for payment in bounties with Harmony One via Metamask - updated data-chains.js to include harmony networks - removing TODOs - fix address validation (we will use eth style addresses instead of 'one...' format) - setting harmony network ®ecommended gas limit and price * [#10430] Adding missing env variable to review env, in order to be able to test bounty creations * [#10428] Removing block that loads hamony extension ressources * [#10428] Revert changes to data-chains as this might have side effects * [#10428] Adding information about harmony network to data-chains.js * [#10428] Have updated the chain id, and verification of mainnet / testnet * Adding fixtures for ONE token and removed commented code Co-authored-by: Gerald Iakobinyi-Pich --- .github/workflows/ci-review.yml | 2 + app/app/fixtures/economy.json | 152 +++++++++++++++++ app/assets/v2/js/data-chains.js | 157 +++++++++++++++++- .../v2/js/pages/bounty_detail/web3_modal.js | 13 ++ app/assets/v2/js/pages/bounty_details.js | 2 +- app/assets/v2/js/pages/bounty_details2.js | 5 +- .../v2/js/pages/fulfill_bounty/token.js | 64 +------ .../v2/js/pages/wallet_address_validation.js | 29 +++- app/assets/v2/js/wallet.js | 4 +- app/dashboard/templates/bounty/details2.html | 14 +- .../templates/bounty/new_bounty.html | 4 +- 11 files changed, 361 insertions(+), 85 deletions(-) diff --git a/.github/workflows/ci-review.yml b/.github/workflows/ci-review.yml index b2d5741e3c3..e61e622c734 100644 --- a/.github/workflows/ci-review.yml +++ b/.github/workflows/ci-review.yml @@ -240,6 +240,8 @@ jobs: DB_PASSWORD: ${{ secrets.DB_PASSWORD }} DB_USER: ${{ secrets.DB_USER }} DOCKER_GTC_WEB_IMAGE: ${{ needs.build-and-test.outputs.dockerTag }} + GITHUB_API_USER: ${{ secrets.REVIEW_GITHUB_API_USER }} + GITHUB_API_TOKEN: ${{ secrets.REVIEW_GITHUB_API_TOKEN }} # Pass in the outputs from the generic environment, we will deploy our ressources in the VPC # and subnet that where created there diff --git a/app/app/fixtures/economy.json b/app/app/fixtures/economy.json index 53f8a672420..30539954431 100644 --- a/app/app/fixtures/economy.json +++ b/app/app/fixtures/economy.json @@ -24373,5 +24373,157 @@ "metadata": {}, "approved": true } + }, + { + "model": "economy.token", + "pk": 365, + "fields": { + "created_on": "2022-04-04T06:28:03Z", + "modified_on": "2022-04-04T06:29:18.680Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Mainnet Shard 0", + "decimals": 18, + "priority": 1, + "chain_id": 1666600000, + "network_id": 1666600000, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 366, + "fields": { + "created_on": "2022-04-04T06:28:03Z", + "modified_on": "2022-04-04T06:29:18.680Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Mainnet Shard 1", + "decimals": 18, + "priority": 1, + "chain_id": 1666600001, + "network_id": 1666600001, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 367, + "fields": { + "created_on": "2022-04-04T06:28:03Z", + "modified_on": "2022-04-04T06:29:18.680Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Mainnet Shard 2", + "decimals": 18, + "priority": 1, + "chain_id": 1666600002, + "network_id": 1666600002, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 368, + "fields": { + "created_on": "2022-04-04T06:29:18Z", + "modified_on": "2022-04-04T06:30:05.945Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Mainnet Shard 3", + "decimals": 18, + "priority": 1, + "chain_id": 1666600003, + "network_id": 1666600003, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 369, + "fields": { + "created_on": "2022-04-04T06:29:18Z", + "modified_on": "2022-04-04T06:30:05.945Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Testnet Shard 0", + "decimals": 18, + "priority": 1, + "chain_id": 1666700000, + "network_id": 1666700000, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 370, + "fields": { + "created_on": "2022-04-04T06:29:18Z", + "modified_on": "2022-04-04T06:30:05.945Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Testnet Shard 1", + "decimals": 18, + "priority": 1, + "chain_id": 1666700001, + "network_id": 1666700001, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 371, + "fields": { + "created_on": "2022-04-04T06:29:18Z", + "modified_on": "2022-04-04T06:30:05.945Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Testnet Shard 2", + "decimals": 18, + "priority": 1, + "chain_id": 1666700002, + "network_id": 1666700002, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } + }, + { + "model": "economy.token", + "pk": 372, + "fields": { + "created_on": "2022-04-04T06:29:18Z", + "modified_on": "2022-04-04T06:30:05.945Z", + "address": "0x0000000000000000000000000000000000000001", + "symbol": "ONE", + "network": "Harmony Testnet Shard 3", + "decimals": 18, + "priority": 1, + "chain_id": 1666700003, + "network_id": 1666700003, + "metadata": {}, + "approved": true, + "conversion_rate_id": "harmony", + "conversion_rate_source": "coingecko" + } } ] diff --git a/app/assets/v2/js/data-chains.js b/app/assets/v2/js/data-chains.js index 576473ffefc..0dc4a7b503b 100644 --- a/app/assets/v2/js/data-chains.js +++ b/app/assets/v2/js/data-chains.js @@ -1,5 +1,6 @@ // https://chainid.network/chains.json // 20200603145449 +// Note: information about harmony network have been appended on 20220330 var dataChains = [ { @@ -1293,7 +1294,161 @@ var dataChains = "symbol": "MATIC", "decimals": 18 }, - "infoURL":"https://matic.network/" + "infoURL": "https://matic.network/" + }, + { + "name": "Harmony Mainnet Shard 0", + "chain": "Harmony", + "rpc": [ + "https://api.harmony.one" + ], + "faucets": [ + "https://free-online-app.com/faucet-for-eth-evm-chains/" + ], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-s0", + "chainId": 1666600000, + "networkId": 1666600000, + "explorers": [ + { + "name": "Harmony Block Explorer", + "url": "https://explorer.harmony.one", + "standard": "EIP3091" + } + ] + }, + { + "name": "Harmony Mainnet Shard 1", + "chain": "Harmony", + "rpc": [ + "https://s1.api.harmony.one" + ], + "faucets": [], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-s1", + "chainId": 1666600001, + "networkId": 1666600001 + }, + { + "name": "Harmony Mainnet Shard 2", + "chain": "Harmony", + "rpc": [ + "https://s2.api.harmony.one" + ], + "faucets": [], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-s2", + "chainId": 1666600002, + "networkId": 1666600002 + }, + { + "name": "Harmony Mainnet Shard 3", + "chain": "Harmony", + "rpc": [ + "https://s3.api.harmony.one" + ], + "faucets": [], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-s3", + "chainId": 1666600003, + "networkId": 1666600003 + }, + { + "name": "Harmony Testnet Shard 0", + "chain": "Harmony", + "rpc": [ + "https://api.s0.b.hmny.io" + ], + "faucets": [ + "https://faucet.pops.one" + ], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-b-s0", + "chainId": 1666700000, + "networkId": 1666700000, + "explorers": [ + { + "name": "Harmony Testnet Block Explorer", + "url": "https://explorer.pops.one", + "standard": "EIP3091" + } + ] + }, + { + "name": "Harmony Testnet Shard 1", + "chain": "Harmony", + "rpc": [ + "https://api.s1.b.hmny.io" + ], + "faucets": [], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-b-s1", + "chainId": 1666700001, + "networkId": 1666700001 + }, + { + "name": "Harmony Testnet Shard 2", + "chain": "Harmony", + "rpc": [ + "https://api.s2.b.hmny.io" + ], + "faucets": [], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-b-s2", + "chainId": 1666700002, + "networkId": 1666700002 + }, + { + "name": "Harmony Testnet Shard 3", + "chain": "Harmony", + "rpc": [ + "https://api.s3.b.hmny.io" + ], + "faucets": [], + "nativeCurrency": { + "name": "ONE", + "symbol": "ONE", + "decimals": 18 + }, + "infoURL": "https://www.harmony.one/", + "shortName": "hmy-b-s3", + "chainId": 1666700003, + "networkId": 1666700003 } ]; diff --git a/app/assets/v2/js/pages/bounty_detail/web3_modal.js b/app/assets/v2/js/pages/bounty_detail/web3_modal.js index d02641f5936..90db3fd8630 100644 --- a/app/assets/v2/js/pages/bounty_detail/web3_modal.js +++ b/app/assets/v2/js/pages/bounty_detail/web3_modal.js @@ -22,6 +22,19 @@ const payWithWeb3 = (fulfillment_id, fulfiller_address, vm, modal) => { }, (error, result) => callback(error, result) ); + } else if (token_name == 'ONE') { + // Gas limit as indicated here: https://docs.harmony.one/home/general/wallets/browser-extensions-wallets/metamask-wallet/sending-and-receiving#sending-a-regular-transaction + web3.eth.sendTransaction( + { + to: fulfiller_address, + from: selectedAccount, + value: web3.utils.toWei(String(amount)), + gasPrice: web3.utils.toHex(30 * Math.pow(10, 9)), + gas: web3.utils.toHex(25000), + gasLimit: web3.utils.toHex(25000) + }, + (error, result) => callback(error, result) + ); } else { const amountInWei = amount * 1.0 * Math.pow(10, vm.decimals); diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index ded8756c8f4..272ed19c9d3 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -274,7 +274,7 @@ var callbacks = { return [ 'fulfillment_accepted_on', timePeg ]; }, 'network': function(key, val, result) { - if (val == 'mainnet') { + if (val.toLowerCase().indexOf('mainnet') >= 0) { $('#network').addClass('hidden'); return [ null, null ]; } diff --git a/app/assets/v2/js/pages/bounty_details2.js b/app/assets/v2/js/pages/bounty_details2.js index 28627519d5d..225c408f28d 100644 --- a/app/assets/v2/js/pages/bounty_details2.js +++ b/app/assets/v2/js/pages/bounty_details2.js @@ -571,6 +571,7 @@ Vue.mixin({ switch (payout_type) { case 'web3_modal': + case 'harmony_ext': payWithWeb3(fulfillment_id, fulfiller_address, vm, modal); break; @@ -582,10 +583,6 @@ Vue.mixin({ payWithBinanceExtension(fulfillment_id, fulfiller_address, vm, modal); break; - case 'harmony_ext': - payWithHarmonyExtension(fulfillment_id, fulfiller_address, vm, modal); - break; - case 'rsk_ext': payWithRSKExtension(fulfillment_id, fulfiller_address, vm, modal); break; diff --git a/app/assets/v2/js/pages/fulfill_bounty/token.js b/app/assets/v2/js/pages/fulfill_bounty/token.js index b7d5f4d97db..97d474b7abc 100644 --- a/app/assets/v2/js/pages/fulfill_bounty/token.js +++ b/app/assets/v2/js/pages/fulfill_bounty/token.js @@ -81,68 +81,6 @@ fulfillBounty = data => { }); }; - const is_valid_address = (address) => { - switch (web3_type) { - - // etc - // celo - // rsk - // binance - - case 'harmony_ext': - if (!address.toLowerCase().startsWith('one')) { - return false; - } - return true; - - case 'sia_ext': - case 'polkadot_ext': - if (address.toLowerCase().startsWith('0x')) { - return false; - } - return true; - - case 'xinfin_ext': - if (!address.toLowerCase().startsWith('xdc')) { - return false; - } - return true; - - case 'nervos_ext': { - const ADDRESS_REGEX = new RegExp('^(ckb){1}[0-9a-zA-Z]{43,92}$'); - const isNervosValid = ADDRESS_REGEX.test(address); - - if (isNervosValid || address.toLowerCase().startsWith('0x')) { - return true; - } - - return false; - } - - case 'qr': - - if (token_name == 'BTC') { - if (address.toLowerCase().startsWith('0x')) { - return false; - } - return true; - } else if (token_name == 'FIL') { - if (!address.toLowerCase().startsWith('fil')) { - return false; - } - return true; - } else if (token_name == 'ZIL') { - if (!address.toLowerCase().startsWith('zil')) { - return false; - } - return true; - } - - return true; - - default: - return true; - } - + return validateWalletAddress(chainId, address); }; diff --git a/app/assets/v2/js/pages/wallet_address_validation.js b/app/assets/v2/js/pages/wallet_address_validation.js index ce8599c6fb0..49dcc0b8c13 100644 --- a/app/assets/v2/js/pages/wallet_address_validation.js +++ b/app/assets/v2/js/pages/wallet_address_validation.js @@ -3,6 +3,19 @@ var validateWalletAddress = function(chainId, address) { let isValid = true; switch (chainId) { + case '1935': // Sia + case '58': // Polkadot + if (address.toLowerCase().startsWith('0x')) { + isValid = false; + } + break; + + case '50': // Xinfin + if (!address.toLowerCase().startsWith('xdc')) { + isValid = false; + } + break; + case '1995': { // nervos const ADDRESS_REGEX = new RegExp('^(ckb){1}[0-9a-zA-Z]{43,92}$'); @@ -38,6 +51,19 @@ var validateWalletAddress = function(chainId, address) { break; } + case '600': // Filecoin + if (!address.toLowerCase().startsWith('fil')) { + isValid = false; + } + break; + + case '102':// Zilliqa + if (!address.toLowerCase().startsWith('zil')) { + isValid = false; + } + break; + + case '270895': { // casper let addr = address; @@ -48,7 +74,8 @@ var validateWalletAddress = function(chainId, address) { break; } - // include validation for other chains here + + // include validation for other chains here } return isValid; diff --git a/app/assets/v2/js/wallet.js b/app/assets/v2/js/wallet.js index 420e96ea445..c283cfad9a5 100644 --- a/app/assets/v2/js/wallet.js +++ b/app/assets/v2/js/wallet.js @@ -95,7 +95,9 @@ async function fetchAccountData(provider) { } await web3.eth.net.getId().then(id => { networkId = id; - networkName = getDataChains(id, 'chainId')[0] && getDataChains(id, 'chainId')[0].network; + const chainInfo = getDataChains(id, 'chainId')[0]; + + networkName = chainInfo && (chainInfo.network || chainInfo.name); }); // web3.currentProvider.chainId // networkName = await web3.eth.net.getNetworkType(); diff --git a/app/dashboard/templates/bounty/details2.html b/app/dashboard/templates/bounty/details2.html index e1ab39c5778..844f11df200 100644 --- a/app/dashboard/templates/bounty/details2.html +++ b/app/dashboard/templates/bounty/details2.html @@ -89,7 +89,7 @@

[[ bounty.title ]

-
+
WARNING: this is a [[bounty.network]] network bounty, and is NOT real money. To see mainnet bounties, go to the bounty explorer and search for mainnet bounties.
@@ -1135,16 +1135,6 @@

{{ noscript.keywords }}

- {% elif web3_type == 'harmony_ext' %} - - - - - - - - - {% elif web3_type == 'rsk_ext' %} @@ -1176,7 +1166,7 @@

{{ noscript.keywords }}

{% endif %} - {% elif web3_type == 'web3_modal' %} + {% elif web3_type == 'web3_modal' or web3_type == 'harmony_ext' %} {% bundle merge_js file web3_modal %} diff --git a/app/dashboard/templates/bounty/new_bounty.html b/app/dashboard/templates/bounty/new_bounty.html index 8fc2580e5ff..4817c94c44a 100644 --- a/app/dashboard/templates/bounty/new_bounty.html +++ b/app/dashboard/templates/bounty/new_bounty.html @@ -86,8 +86,8 @@

Fund Issue

Binance -