From 7c65b3932af36afc3ad83826b3e32ef4d78694e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Wed, 27 Jul 2022 12:28:56 -0500 Subject: [PATCH] Challenge #3 Challenge #3 Pokemon skills --- PokemonFactory.sol | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/PokemonFactory.sol b/PokemonFactory.sol index 94eb838d..22b707cb 100644 --- a/PokemonFactory.sol +++ b/PokemonFactory.sol @@ -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; - } - -}