Skip to content

Solidity based smartcontract to register usernames to a wallet address

Notifications You must be signed in to change notification settings

Preetnagda/UsernameLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Username library

This project uses hardhat framework to create a smartcontract where you can register a username for your wallet address.

This smartcontract is developed for goerli testnet and ethereum blockchain. Smartcontract is written in solidity.

Test

npx hardhat test

Deploy

npx hardhat run scripts/deploy.js

Interact with SmartContract

Once the smartcontract is deployed, you can interact to it using the following functions:

registerUser()

This function takes a username as an argument. It maps your current wallet address to the username you provide. It will not allow duplicate usernames and multiple username registration for one wallet.

getUsername()

It is a view functions and hence does not cost any gas.

Pass a address to this function and get the username corresponding to it, if it exists.

getAddress()

It is a view functions and hence does not cost any gas.

Pass a username to this function and get the address corresponding to it, if it exists.

About

Solidity based smartcontract to register usernames to a wallet address

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published