Skip to content

Commit

Permalink
conditionally show more information when grant is contract
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Solorio committed Dec 14, 2021
1 parent d530fc6 commit 43fc65a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 11 additions & 0 deletions app/assets/v2/js/grants/_detail-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,17 @@ Vue.component('grant-details', {
]
};
},
computed: {
async grantIsContract() {
const { admin_address } = this.grant
if (admin_address) {
const code = await web3.eth.getCode(admin_address);

return code !== '0x';
}
return false;
}
},
mounted: function() {
const vm = this;

Expand Down
10 changes: 8 additions & 2 deletions app/grants/templates/grants/detail/template-grant-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,14 @@ <h3>About</h3>
<i class="fal fa-wallet mr-1"></i>
You’ve received L2 contributions
</p>
Some of your grant funds may be in L2 (zkSync or Polygon). Polygon contributions are not supported
for your grant since it is using a contract address (e.g. Gnosis Safe, multi-sig wallet).
Some of your grant funds may be in L2 (zkSync or Polygon).
<span v-if="grantIsContract">
Polygon contributions are not supported
for your grant since it is using a contract address (e.g. Gnosis Safe, multi-sig wallet).
</span>
<span v-else>
Read more on how to withdraw from L2 wallets.
</span>
</b-card-text>
<a class="btn btn-block btn-primary" rel="noopener noreferrer" href="https://support.gitcoin.co/kb/article/75-how-do-i-withdraw-my-funds-from-an-l2-layer-zksync-and-or-polygon-matic/" target="_blank">
Read L2 Withdrawal guide
Expand Down

0 comments on commit 43fc65a

Please sign in to comment.