Created
May 30, 2022 11:49
-
-
Save IgnacioPardo/90b060baf0b2231bceeb65c1a6d44919 to your computer and use it in GitHub Desktop.
0x6427D0035314c3Ad779a24e4CF3DCD0eE6546F4b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.10; | |
contract Superhero{ | |
string private _name; | |
mapping(string => int) private _poderes; | |
address private _owner; | |
constructor(string memory name_){ | |
_name = name_; | |
_owner = msg.sender; | |
} | |
function name() public view returns (string memory){ | |
return _name; | |
} | |
function set_power(string memory power, int valor) public{ | |
require(_owner == msg.sender, "Solo el creador puede setear poderes"); | |
_poderes[power] = valor; | |
} | |
function get_power(string memory power) public view returns (int){ | |
return _poderes[power]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment