Post
Topic
Board Разное
Re: Обсуждение смарт-контрактов запрещено.
by
kzv
on 21/02/2019, 08:14:25 UTC
Амаклин, дался тебе этот хэловорд. Что ты с ним делать собрался?
Вот треться ссылка с гугла привела

https://www.ethereum.org/greeter

Code:
pragma solidity >=0.4.22 <0.6.0;

contract Mortal {
    /* Define variable owner of the type address */
    address owner;

    /* This constructor is executed at initialization and sets the owner of the contract */
    constructor() public { owner = msg.sender; }

    /* Function to recover the funds on the contract */
    function kill() public { if (msg.sender == owner) selfdestruct(msg.sender); }
}

contract Greeter is Mortal {
    /* Define variable greeting of the type string */
    string greeting;

    /* This runs when the contract is executed */
    constructor(string memory _greeting) public {
        greeting = _greeting;
    }

    /* Main function */
    function greet() public view returns (string memory) {
        return greeting;
    }
}