Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. pragma solidity >=0.4.22 <0.6.0;
  2.  
  3. contract Object{
  4. address owner;
  5.  
  6. struct Attribute{
  7. string attrName;
  8. string attrValue;
  9. }
  10.  
  11. mapping(string=>string) oa;
  12.  
  13. constructor(address _owner)public{
  14. owner = _owner;
  15. }
  16.  
  17. function appendAttribute(string memory _attrName,string memory _value) public{
  18. oa[_attrName] = _value;
  19.  
  20. }
  21.  
  22. function getAttriuteValue(string memory _attrName)
  23. public
  24. returns (string memory)
  25. {
  26. return oa[_attrName];
  27. }
  28.  
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement