SHARE
TWEET

DIS IS SANDPIT TURTLE

a guest Sep 17th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pragma solidity 0.4.24;
  2. pragma experimental ABIEncoderV2;
  3.  
  4. contract Project {
  5.     address public owner;
  6.     bytes32 public name;
  7.     bytes32 public description;
  8.     bytes32 public url;
  9.     uint public date;
  10.    
  11.     struct ProjectData {
  12.         bytes32 name;
  13.         bytes32 description;
  14.         bytes32 url;
  15.     }
  16.    
  17.     mapping (address => ProjectData) data;
  18.    
  19.     constructor() public {
  20.         owner = msg.sender;
  21.         date = now;
  22.     }
  23.    
  24.     modifier onlyOwner() {
  25.         require(owner == msg.sender, "Sender not authorized.");
  26.         _;
  27.     }
  28.    
  29.     function setProject(
  30.         bytes32 name,
  31.         bytes32 description,
  32.         bytes32 url) public onlyOwner returns (ProjectData)
  33.     {
  34.         data[owner].name = name;
  35.         data[owner].description = description;
  36.         data[owner].url = url;
  37.        
  38.         return data[owner];
  39.     }
  40.    
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top