Код IT
← Каталог

Блокчейн, крипта и NFT — Особенности обработки смарт-контрактов

Фрагмент из «Блокчейн, крипта и NFT»: Особенности обработки смарт-контрактов.

text spinoffencyclopedia9-05-blokcheyn-kripta-i-nft-1 embed URL статья в энциклопедии
Plain text main.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Counter {
    uint256 public count;
    address public owner;

    constructor() {
        owner = msg.sender;
    }

    function increment() external {
        require(msg.sender == owner, "not owner");
        count += 1;
    }
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Counter {
    uint256 public count;
    address public owner;

    constructor() {
        owner = msg.sender;
    }

    function increment() external {
        require(msg.sender == owner, "not owner");
        count += 1;
    }
}