NEAR-Edu / near-certification-tools

2 stars 2 forks source link

validate mainnet account IDs #71

Open ryancwalsh opened 2 years ago

ryancwalsh commented 2 years ago

Looking at nc-submissions, we see a bunch of potential problems:

At a minimum we should:

encody commented 2 years ago

Is this frontend validation? It would technically be possible to implement on the contract level, but I'm not sure how effective / efficient it would be, especially since account validation on the frontend is as simple as sending a view_account RPC request and checking the response for error.

ryancwalsh commented 2 years ago

@encody Yeah I was not thinking in the contract. Ideally we'd have some validation in the form, but I think it's hosted by Airtable and won't allow that kind of validation, so we'll want some rules in our API endpoint and/or Make.com.

I think view_account might not fully work for implicit accounts that have no transactions yet.

encody commented 2 years ago

I think view_account might not fully work for implicit accounts that have no transactions yet.

Yes, it will not work, but I do hope we're not certifying people who don't have NEAR accounts.

ryancwalsh commented 2 years ago

@encody It does seem ridiculous to request a cert to an unnamed account: https://certificates.near.university/account/2d956a7e4908ebfaec3bf62fa23062644279c4e86dfc3278097cbc11f30e6ba3

We probably shouldn't allow it.

ryancwalsh commented 2 years ago

I created a simple formulaic mainnet validation check at https://airtable.com/appncY8IjPHkOVapz/tblz5izwaj0N12wBT/viwHft7HaoK95oxUn?blocks=hide

When deciding students to add to upcoming batches, let's exclude anyone whose mainnet accounts are wonky. Later, we'll reach out to them individually to have them give use fixed named mainnet accounts.

ryancwalsh commented 2 years ago

I added a tip to our form at https://airtable.com/appncY8IjPHkOVapz/tblz5izwaj0N12wBT/viw0a4Z2zbDD0vH1B?blocks=hide

Note: only account names ending in ".near" will work.