DEV Community

Cover image for Created a Profile Storage SmartContract and Deployed on XinFin XDC Network.
MahaLakshmi Perumal
MahaLakshmi Perumal

Posted on

1

Created a Profile Storage SmartContract and Deployed on XinFin XDC Network.

Created a SmartContract in Solidity language to store the user's profile with Name, description, URL, Image. Deployed the #SmartContract on XinFin XDC Network.
Check the code here:

pragma solidity ^0.5.0;
contract Profile {
struct User {
string name;
string subtitle;
string sdescription;
string ldescription;
string weburl;
string imghash;
}
mapping(address => User) public users;
function set(string memory _name, string memory _subtitle, string memory _sdescription,string memory _ldescription, string memory _weburl, string memory _imghash) public {
users[msg.sender] = User(_name, _subtitle, _sdescription, _ldescription, _weburl, _imghash);
}
function get() public view returns (string memory, string memory, string memory, string memory, string memory, string memory) {
return (
users[msg.sender].name,
users[msg.sender].subtitle,
users[msg.sender].sdescription,
users[msg.sender].ldescription,
users[msg.sender].weburl,
users[msg.sender].imghash
);
}}

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay