Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Import solidity

Tự học Solidity bài 18: Import trong ngôn ngữ lập trình Solidity

Import  Solidity  Ngôn ngữ lập trình Solidity. Tự học Solidity miễn phí.  Trong khoá học online miễn phí Tự học lập trình web3 - Tự học ngôn ngữ lập trình Solidity Summary for English Visiter pragma solidity >=0.5.0 <0.6.0; import "./zombiefactory.sol"; contract ZombieFeeding is ZombieFactory { } Thank you! Bạn hay xem 2 file Solidity dưới đây 1 File: zombilefactory.sol pragma solidity >= 0.5.0 < 0.6.0 ; contract ZombieFactory { event NewZombie ( uint zombieId , string name , uint dna ); uint dnaDigits = 16 ; uint dnaModulus = 10 ** dnaDigits ; struct Zombie { string name ; uint dna ; } Zombie [] public zombies ; mapping ( uint => address ) public zombieToOwner ; mapping ( address => uint ) ownerZombieCount ; function _createZombie ( string memory _name , uint _dna ) private { uint id = zombies . push ( Zombie ( _name , _dna )) - 1 ; zombieToOwner [ id