You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we have a smart contract for ORCID. We will want to make one for Google, Facebook etc.
We also want a general contract.
It should have getAllAccounts(address user) which takes the address of a user as an argument, looks up their address in the ORCID, Google, Facebook, et al.'s 'credsForAddress' hashmap, and returns all of their accounts, in whatever format you want. It could be an array or struct, perhaps JSON string. I think struct is best though unless there's a strong reason otherwise. The credentials are stored as bytes, not a string, so it may be easiest to do a struct with lots of byte fields and let the frontend convert bytes to string.
It should also have getAccount(address user, string memory account) which gets a specific account's credentials, again in byte format.
It should ideally have getAccounts(address user, string[] accounts) which does the same but for multiple accounts and returns an array of credentials in byte format. The array will be in the same order as the arguments.
One thing which is annoying is that solidity can't take string arrays, so the string[] accounts won't actually work. So I'm thinking we should limit our accounts ('google', 'orcid', 'facebook', et al.) to a number of characters and take bytes[] or bytes16[] / bytes32[] etc.
The text was updated successfully, but these errors were encountered:
Right now, we have a smart contract for ORCID. We will want to make one for Google, Facebook etc.
We also want a general contract.
It should have
getAllAccounts(address user)
which takes the address of a user as an argument, looks up their address in the ORCID, Google, Facebook, et al.'s 'credsForAddress' hashmap, and returns all of their accounts, in whatever format you want. It could be an array or struct, perhaps JSON string. I think struct is best though unless there's a strong reason otherwise. The credentials are stored as bytes, not a string, so it may be easiest to do a struct with lots of byte fields and let the frontend convert bytes to string.It should also have
getAccount(address user, string memory account)
which gets a specific account's credentials, again in byte format.It should ideally have
getAccounts(address user, string[] accounts)
which does the same but for multiple accounts and returns an array of credentials in byte format. The array will be in the same order as the arguments.One thing which is annoying is that solidity can't take string arrays, so the
string[]
accounts won't actually work. So I'm thinking we should limit our accounts ('google', 'orcid', 'facebook', et al.) to a number of characters and takebytes[]
orbytes16[]
/bytes32[]
etc.The text was updated successfully, but these errors were encountered: