Skip to content

Instantly share code, notes, and snippets.

View joaoaguiam's full-sized avatar

Joao Aguiam joaoaguiam

View GitHub Profile
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreie33homqk3nukfqc3aa5yypft2fv3sdxaywijmotzp7ewept3yp2q ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
### Keybase proof
I hereby claim:
* I am joaoaguiam on github.
* I am joaoaguiam (https://keybase.io/joaoaguiam) on keybase.
* I have a public key ASC4ElT7-PeexDYUxCFQfxCnrkK3h16N26J1quk9NMMK-wo
To claim this, I am signing this object:
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmWDjTTmxsFU1E7ecugdx6T3DWKHbYoKtZduqK87YD6ADM ✅
Create your profile today to start building social connection and trust online. https://3box.io/
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmWDjTTmxsFU1E7ecugdx6T3DWKHbYoKtZduqK87YD6ADM ✅
Create your profile today to start building social connection and trust online. https://3box.io/
did:muport:0x12345
did:muport:QmXfdXB8h9UzCT5XNmMhkuYuG49LYTPJcJAwhWorHhsCo4-----
test gist api
const verifiers = require("./utils/verifiers");
class VerifiedAccounts {
constructor(box) {
this._box = box;
this._did = box._muportDID.getDid();
}
/**
* Internal function to prevent using the methods without having been initialized with a 3Box
module.exports = {
/**
* Verify github account method. It will return the github username if verified correctly.
* @param did DID of the user to be verified
* @param proof URL to the gist file under the user account containing the user DID.
* @returns Object containing the github user in the data field and in case of error, the error message under the error field.
*/
verifyGithub: async (did, proof) => {
if (!proof || proof.trim() === "") {
throw new Error("verifyGithub: proof (gist url) parameter is not present");
address public grantSigner;
function stake(address _userUportAddress, uint _expiryDate, bytes _signature) public payable whenNotPaused {
bytes32 hashMessage = keccak256(abi.encodePacked(_userUportAddress, msg.value, _expiryDate));
address signer = hashMessage.toEthSignedMessageHash().recover(_signature);
require(signer == grantSigner, "Signature is not valid");
require(block.timestamp < _expiryDate, "Grant is expired");
require(userStakedAddress[_userUportAddress] == 0, "User has already staked!");