Skip to content

Commit

Permalink
Challenge gelopfalcon#3
Browse files Browse the repository at this point in the history
Challenge gelopfalcon#3 Pokemon skills
  • Loading branch information
jejimenez authored Jul 27, 2022
1 parent 8bef98c commit 7c65b39
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions PokemonFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,3 @@ contract PokemonFactory {
}

}

contract PokemonFactory {

struct Pokemon {
uint id;
string name;
}

event eventNewPokemon(Pokemon pokemon);

Pokemon[] private pokemons;

mapping (uint => address) public pokemonToOwner;
mapping (address => uint) ownerPokemonCount;

function createPokemon (string memory _name, uint _id) public {
require(_id > 0, "Id should be more than 0.");
require(bytes(_name).length >= 2, "name needs at least two letters");
pokemons.push(Pokemon(_id, _name));
pokemonToOwner[_id] = msg.sender;
ownerPokemonCount[msg.sender]++;
emit eventNewPokemon(Pokemon(_id, _name));
}

function getAllPokemons() public view returns (Pokemon[] memory) {
return pokemons;
}


function getResult() public pure returns(uint product, uint sum){
uint a = 1;
uint b = 2;
product = a * b;
sum = a + b;
}

}

0 comments on commit 7c65b39

Please sign in to comment.