diff --git a/lesson-1/chapter-13/Contract.sol b/lesson-1/chapter-13/Contract.sol index 8e834a2..7fed6be 100644 --- a/lesson-1/chapter-13/Contract.sol +++ b/lesson-1/chapter-13/Contract.sol @@ -15,7 +15,8 @@ contract ZombieFactory { Zombie[] public zombies; function _createZombie(string _name, uint _dna) private { - uint id = zombies.push(Zombie(_name, _dna)) - 1; + zombies.push(Zombie(_name, _dna)); + uint id = zombies.length - 1; emit NewZombie(id, _name, _dna); } @@ -29,4 +30,4 @@ contract ZombieFactory { _createZombie(_name, randDna); } -} \ No newline at end of file +}